Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Inglis <Brian.Inglis@SystematicSW.ab.ca>2022-10-22 08:15:18 +0300
committerCorinna Vinschen <corinna@vinschen.de>2022-10-24 15:07:23 +0300
commitd6a26e542da06d0ded2b8eefbd019fc93fdec019 (patch)
treebea36cc34ba881ae88fd356c9b214d24a878b83f /newlib/libc
parent7589034cc3151bfac8cc3d3af5e91402a78e160b (diff)
strptime.c(strptime_l): add %q GNU quarter
Diffstat (limited to 'newlib/libc')
-rw-r--r--newlib/libc/time/strptime.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/newlib/libc/time/strptime.c b/newlib/libc/time/strptime.c
index 12b2ef469..6220ff73a 100644
--- a/newlib/libc/time/strptime.c
+++ b/newlib/libc/time/strptime.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999 Kungliga Tekniska Högskolan
+ * Copyright (c) 1999 Kungliga Tekniska Högskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -298,6 +298,14 @@ strptime_l (const char *buf, const char *format, struct tm *timeptr,
} else
timeptr->tm_hour += 12;
break;
+ case 'q' : /* quarter year - GNU extension */
+ ret = strtol_l (buf, &s, 10, locale);
+ if (s == buf)
+ return NULL;
+ timeptr->tm_mon = (ret - 1)*3;
+ buf = s;
+ ymd |= SET_MON;
+ break;
case 'r' : /* %I:%M:%S %p */
s = strptime_l (buf, _ctloc (ampm_fmt), timeptr, locale);
if (s == NULL)