aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-05-31 07:34:14 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-05-31 07:34:14 +0000
commitd12fcc20dac8415a89898fdaa9bfabaac39e5e33 (patch)
treefca611e3fc499941e4c294fd22edf409fde9f1ed
parent3e57adb73198874b3924cb9aa8770193c894b1a9 (diff)
downloadbusybox-w32-d12fcc20dac8415a89898fdaa9bfabaac39e5e33.tar.gz
busybox-w32-d12fcc20dac8415a89898fdaa9bfabaac39e5e33.tar.bz2
busybox-w32-d12fcc20dac8415a89898fdaa9bfabaac39e5e33.zip
libiproute: fix option parsing, so that "ip -o link" works again.
closes bug 3524
-rw-r--r--libbb/compare_string_array.c4
-rw-r--r--networking/libiproute/ip_parse_common_args.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/libbb/compare_string_array.c b/libbb/compare_string_array.c
index 151b50817..ec7f94e79 100644
--- a/libbb/compare_string_array.c
+++ b/libbb/compare_string_array.c
@@ -23,7 +23,7 @@ int index_in_strings(const char *strings, const char *key)
23{ 23{
24 int idx = 0; 24 int idx = 0;
25 25
26 while (strings[0]) { 26 while (*strings) {
27 if (strcmp(strings, key) == 0) { 27 if (strcmp(strings, key) == 0) {
28 return idx; 28 return idx;
29 } 29 }
@@ -57,7 +57,7 @@ int index_in_substrings(const char *strings, const char *key)
57 57
58 if (len) { 58 if (len) {
59 int idx = 0; 59 int idx = 0;
60 while (strings[0]) { 60 while (*strings) {
61 if (strncmp(strings, key, len) == 0) { 61 if (strncmp(strings, key, len) == 0) {
62 return idx; 62 return idx;
63 } 63 }
diff --git a/networking/libiproute/ip_parse_common_args.c b/networking/libiproute/ip_parse_common_args.c
index 294bde540..5e4012b81 100644
--- a/networking/libiproute/ip_parse_common_args.c
+++ b/networking/libiproute/ip_parse_common_args.c
@@ -54,7 +54,7 @@ char **ip_parse_common_args(char **argv)
54 break; 54 break;
55 } 55 }
56 } 56 }
57 arg = index_in_strings(ip_common_commands, opt); 57 arg = index_in_substrings(ip_common_commands, opt);
58 if (arg < 0) 58 if (arg < 0)
59 bb_show_usage(); 59 bb_show_usage();
60 if (arg == ARG_oneline) { 60 if (arg == ARG_oneline) {