make wide scanf %[ respect width
This commit is contained in:
parent
0072251572
commit
99fbf4cfdb
1 changed files with 3 additions and 2 deletions
|
|
@ -243,7 +243,7 @@ int vfwscanf(FILE *f, const wchar_t *fmt, va_list ap)
|
||||||
|
|
||||||
int gotmatch = 0;
|
int gotmatch = 0;
|
||||||
|
|
||||||
for (;;) {
|
while (width) {
|
||||||
if ((c=getwc(f))<0) break;
|
if ((c=getwc(f))<0) break;
|
||||||
if (in_set(p, c) == invert)
|
if (in_set(p, c) == invert)
|
||||||
break;
|
break;
|
||||||
|
|
@ -255,9 +255,10 @@ int vfwscanf(FILE *f, const wchar_t *fmt, va_list ap)
|
||||||
if (s) s+=l;
|
if (s) s+=l;
|
||||||
}
|
}
|
||||||
pos++;
|
pos++;
|
||||||
|
width--;
|
||||||
gotmatch=1;
|
gotmatch=1;
|
||||||
}
|
}
|
||||||
ungetwc(c, f);
|
if (width) ungetwc(c, f);
|
||||||
|
|
||||||
if (!gotmatch) goto match_fail;
|
if (!gotmatch) goto match_fail;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue