diff options
author | ache <ache@FreeBSD.org> | 1999-11-30 08:11:13 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1999-11-30 08:11:13 +0000 |
commit | 6219664f076ec12bbe553606ea50dc99d637ae6b (patch) | |
tree | 8907002d2de74846c4f5b0705ae46cda90af13f5 | |
parent | 228a52df6fbe55b20039947ab11297e75162e903 (diff) | |
download | FreeBSD-src-6219664f076ec12bbe553606ea50dc99d637ae6b.zip FreeBSD-src-6219664f076ec12bbe553606ea50dc99d637ae6b.tar.gz |
Stricter checking %A vs %a
-rw-r--r-- | lib/libc/stdtime/strptime.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/lib/libc/stdtime/strptime.c b/lib/libc/stdtime/strptime.c index d92430a..687cafa 100644 --- a/lib/libc/stdtime/strptime.c +++ b/lib/libc/stdtime/strptime.c @@ -281,17 +281,19 @@ label: case 'A': case 'a': for (i = 0; i < asizeof(Locale->weekday); i++) { - len = strlen(Locale->weekday[i]); - if (strncasecmp(buf, - Locale->weekday[i], - len) == 0) - break; - - len = strlen(Locale->wday[i]); - if (strncasecmp(buf, - Locale->wday[i], - len) == 0) - break; + if (c == 'A') { + len = strlen(Locale->weekday[i]); + if (strncasecmp(buf, + Locale->weekday[i], + len) == 0) + break; + } else { + len = strlen(Locale->wday[i]); + if (strncasecmp(buf, + Locale->wday[i], + len) == 0) + break; + } } if (i == asizeof(Locale->weekday)) return 0; |