newlib: vfwscanf: fix negation bug in %[ conversion
Old BSD bug: While ^ is recognized and the set of matching characters is negated, the code neglects to increment the pointer pointing to the matching characters. Thus, on a negation expression like %[^xyz], the matching doesn't only stop at x, y, or z, but incorrectly also on ^. Fix this by setting the start pointer after recognizing the ^. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
parent
8f7c712bb8
commit
67e628fa33
@ -783,7 +783,6 @@ _DEFUN(__SVFWSCANF_R, (rptr, fp, fmt0, ap),
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case L'[':
|
case L'[':
|
||||||
ccls = fmt;
|
|
||||||
if (*fmt == '^')
|
if (*fmt == '^')
|
||||||
{
|
{
|
||||||
cclcompl = 1;
|
cclcompl = 1;
|
||||||
@ -791,6 +790,7 @@ _DEFUN(__SVFWSCANF_R, (rptr, fp, fmt0, ap),
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
cclcompl = 0;
|
cclcompl = 0;
|
||||||
|
ccls = fmt;
|
||||||
if (*fmt == ']')
|
if (*fmt == ']')
|
||||||
fmt++;
|
fmt++;
|
||||||
while (*fmt != '\0' && *fmt != ']')
|
while (*fmt != '\0' && *fmt != ']')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user