summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/libc/stdtime/strptime.c24
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;
OpenPOWER on IntegriCloud