int *percent)
{
const char *p = str;
+ int digit_seen = 0;
if (len < 2)
return __get_mult_bytes(str, data, percent);
* Go forward until we hit a non-digit, or +/- sign
*/
while ((p - str) <= len) {
- if (!isdigit((int) *p) && (*p != '+') && (*p != '-'))
+ if (!isdigit((int) *p) &&
+ (((*p != '+') && (*p != '-')) || digit_seen))
break;
+ digit_seen |= isdigit((int) *p);
p++;
}
posval_sort(o, posval);
- if (!o->posval[0].ival)
+ if (!o->posval[0].ival) {
+ vp = NULL;
goto match;
+ }
ret = 1;
for (i = 0; i < PARSE_MAX_VP; i++) {
if (rest) {
*rest = '\0';
ptr = rest + 1;
- } else
+ } else if (vp && vp->cb)
ptr = NULL;
break;
}