libbb: make index_in_substrings return -1 on ambiguous matches

function                                             old     new   delta
index_in_substrings                                   67      93     +26

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2010-04-03 00:52:16 +02:00
parent 05d1a32192
commit 8a659f6ff9
3 changed files with 24 additions and 7 deletions

View File

@@ -435,8 +435,8 @@ int FAST_FUNC udhcp_str2optset(const char *const_str, void *arg)
}
break;
// case OPTION_BOOLEAN: {
// static const char noyes[] ALIGN1 = "no\0yes\0";
// buffer[0] = retval = index_in_strings(noyes, val);
// static const char no_yes[] ALIGN1 = "no\0yes\0";
// buffer[0] = retval = index_in_strings(no_yes, val);
// retval++; /* 0 - bad; 1: "no" 2: "yes" */
// break;
// }