this is mandated by C and POSIX standards and is in accordance with
glibc behavior.
continue;
}
if (*p != '%' || p[1] == '%') {
- p += *p=='%';
shlim(f, 0);
- c = shgetc(f);
+ if (*p == '%') {
+ p++;
+ while (isspace((c=shgetc(f))));
+ } else {
+ c = shgetc(f);
+ }
if (c!=*p) {
shunget(f);
if (c<0) goto input_fail;
goto match_fail;
}
- pos++;
+ pos += shcnt(f);
continue;
}
continue;
}
if (*p != '%' || p[1] == '%') {
- p += *p=='%';
- c = getwc(f);
+ if (*p == '%') {
+ p++;
+ while (iswspace((c=getwc(f)))) pos++;
+ } else {
+ c = getwc(f);
+ }
if (c!=*p) {
ungetwc(c, f);
if (c<0) goto input_fail;