libiproute: fix option parsing, so that "ip -o link" works again.
closes bug 3524
This commit is contained in:
		| @@ -23,7 +23,7 @@ int index_in_strings(const char *strings, const char *key) | |||||||
| { | { | ||||||
| 	int idx = 0; | 	int idx = 0; | ||||||
|  |  | ||||||
| 	while (strings[0]) { | 	while (*strings) { | ||||||
| 		if (strcmp(strings, key) == 0) { | 		if (strcmp(strings, key) == 0) { | ||||||
| 			return idx; | 			return idx; | ||||||
| 		} | 		} | ||||||
| @@ -57,7 +57,7 @@ int index_in_substrings(const char *strings, const char *key) | |||||||
|  |  | ||||||
| 	if (len) { | 	if (len) { | ||||||
| 		int idx = 0; | 		int idx = 0; | ||||||
| 		while (strings[0]) { | 		while (*strings) { | ||||||
| 			if (strncmp(strings, key, len) == 0) { | 			if (strncmp(strings, key, len) == 0) { | ||||||
| 				return idx; | 				return idx; | ||||||
| 			} | 			} | ||||||
|   | |||||||
| @@ -54,7 +54,7 @@ char **ip_parse_common_args(char **argv) | |||||||
| 				break; | 				break; | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 		arg = index_in_strings(ip_common_commands, opt); | 		arg = index_in_substrings(ip_common_commands, opt); | ||||||
| 		if (arg < 0) | 		if (arg < 0) | ||||||
| 			bb_show_usage(); | 			bb_show_usage(); | ||||||
| 		if (arg == ARG_oneline) { | 		if (arg == ARG_oneline) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user