mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-18 12:29:32 +08:00
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;
|
||||
|
||||
case L'[':
|
||||
ccls = fmt;
|
||||
if (*fmt == '^')
|
||||
{
|
||||
cclcompl = 1;
|
||||
@ -791,6 +790,7 @@ _DEFUN(__SVFWSCANF_R, (rptr, fp, fmt0, ap),
|
||||
}
|
||||
else
|
||||
cclcompl = 0;
|
||||
ccls = fmt;
|
||||
if (*fmt == ']')
|
||||
fmt++;
|
||||
while (*fmt != '\0' && *fmt != ']')
|
||||
|
Loading…
x
Reference in New Issue
Block a user