Fix up whitespace skipping

This commit is contained in:
Laurence Withers 2007-07-23 14:22:40 +00:00
parent 1b6343e474
commit 674e705d05
1 changed files with 7 additions and 3 deletions

View File

@ -94,13 +94,13 @@ int iso8601_parse(const char* str, struct iso8601_date* earliest, struct iso8601
switch(dig) {
case 4: /* YYYY */
y = num;
goto done;
break;
case 6: /* YYYYMM */
qr = div(num, 100);
y = qr.quot;
m = qr.rem;
goto done;
break;
case 7: /* YYYYJJJ */
qr = div(num, 1000);
@ -121,7 +121,7 @@ int iso8601_parse(const char* str, struct iso8601_date* earliest, struct iso8601
}
switch(ch) {
case '0':
case 0:
goto done;
case 'T':
@ -148,6 +148,9 @@ int iso8601_parse(const char* str, struct iso8601_date* earliest, struct iso8601
dig = 0;
state = state_week_basic;
break;
default:
ERROR_IF(1);
}
break;
@ -531,6 +534,7 @@ int iso8601_parse(const char* str, struct iso8601_date* earliest, struct iso8601
}
done:
--str;
while(*str) ERROR_IF(!isspace(*str++));
if(neg) y *= -1;