diff options
author | Denis Vlasenko | 2007-07-24 15:54:42 +0000 |
---|---|---|
committer | Denis Vlasenko | 2007-07-24 15:54:42 +0000 |
commit | 990d0f63eeb502c8762076e5c5499196e09cba55 (patch) | |
tree | 30a2091a8159b1694d65f9952e2aba2667d7dc11 /archival | |
parent | bcb66ec22e82f6b1ab93f3aec917269393a5b464 (diff) | |
download | busybox-990d0f63eeb502c8762076e5c5499196e09cba55.zip busybox-990d0f63eeb502c8762076e5c5499196e09cba55.tar.gz |
Replace index_in_[sub]str_array with index_in_[sub]strings,
which scans thru "abc\0def\0123\0\0" type strings. Saves 250 bytes.
text data bss dec hex filename
781266 1328 11844 794438 c1f46 busybox_old
781010 1328 11844 794182 c1e46 busybox_unstripped
Diffstat (limited to 'archival')
-rw-r--r-- | archival/dpkg.c | 11 | ||||
-rw-r--r-- | archival/tar.c | 2 |
2 files changed, 6 insertions, 7 deletions
diff --git a/archival/dpkg.c b/archival/dpkg.c index 0c1f541..bd729a2 100644 --- a/archival/dpkg.c +++ b/archival/dpkg.c @@ -582,10 +582,9 @@ static int read_package_field(const char *package_buffer, char **field_name, cha static unsigned fill_package_struct(char *control_buffer) { - static const char *const field_names[] = { "Package", "Version", - "Pre-Depends", "Depends","Replaces", "Provides", - "Conflicts", "Suggests", "Recommends", "Enhances", NULL - }; + static const char field_names[] = "Package\0""Version\0" + "Pre-Depends\0""Depends\0""Replaces\0""Provides\0" + "Conflicts\0""Suggests\0""Recommends\0""Enhances\0"; common_node_t *new_node = xzalloc(sizeof(common_node_t)); char *field_name; @@ -602,10 +601,10 @@ static unsigned fill_package_struct(char *control_buffer) &field_name, &field_value); if (field_name == NULL) { - goto fill_package_struct_cleanup; /* Oh no, the dreaded goto statement ! */ + goto fill_package_struct_cleanup; /* Oh no, the dreaded goto statement! */ } - field_num = index_in_str_array(field_names, field_name); + field_num = index_in_strings(field_names, field_name); switch (field_num) { case 0: /* Package */ new_node->name = search_name_hashtable(field_value); diff --git a/archival/tar.c b/archival/tar.c index d03b18b..7d7bf79 100644 --- a/archival/tar.c +++ b/archival/tar.c @@ -752,7 +752,7 @@ static const char tar_longopts[] = # if ENABLE_FEATURE_TAR_FROM "exclude\0" Required_argument "\xff" # endif - "\0"; + ; #endif int tar_main(int argc, char **argv); |