summaryrefslogtreecommitdiff
path: root/dpkg_deb.c
diff options
context:
space:
mode:
authorGlenn L McGrath <bug1@ihug.co.nz>2001-07-18 15:47:21 +0000
committerGlenn L McGrath <bug1@ihug.co.nz>2001-07-18 15:47:21 +0000
commitc3fbec73fb45997918bef927cea519866e1e1c9d (patch)
tree5c1fd9758c4c9894bb050d9c152e1735bc007536 /dpkg_deb.c
parent8d3b0497a4d8866f0cafd873f241971c2871d580 (diff)
downloadbusybox-w32-c3fbec73fb45997918bef927cea519866e1e1c9d.tar.gz
busybox-w32-c3fbec73fb45997918bef927cea519866e1e1c9d.tar.bz2
busybox-w32-c3fbec73fb45997918bef927cea519866e1e1c9d.zip
Change read_package_field interface, and rewrite using low level functions
Fixes for a few bugs that have crept into dpkg in the last few days
Diffstat (limited to 'dpkg_deb.c')
-rw-r--r--dpkg_deb.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/dpkg_deb.c b/dpkg_deb.c
index 7f4dcbf01..a933c6948 100644
--- a/dpkg_deb.c
+++ b/dpkg_deb.c
@@ -110,12 +110,17 @@ extern int dpkg_deb_main(int argc, char **argv)
110 } 110 }
111 else if (arg_type == arg_type_field) { 111 else if (arg_type == arg_type_field) {
112 char *field = NULL; 112 char *field = NULL;
113 char *name;
114 char *value;
113 int field_start = 0; 115 int field_start = 0;
114 116
115 while ((field = read_package_field(&output_buffer[field_start])) != NULL) { 117 while (1) {
116 field_start += (strlen(field) + 1); 118 field_start += read_package_field(&output_buffer[field_start], &name, &value);
117 if (strstr(field, argv[optind + 1]) == field) { 119 if (name == NULL) {
118 puts(field + strlen(argv[optind + 1]) + 2); 120 break;
121 }
122 if (strcmp(name, argv[optind + 1]) == 0) {
123 puts(value);
119 } 124 }
120 free(field); 125 free(field);
121 } 126 }