aboutsummaryrefslogtreecommitdiffstats
path: root/main/musl/1003-implement-y-and-C-specifiers-in-strptime.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/musl/1003-implement-y-and-C-specifiers-in-strptime.patch')
-rw-r--r--main/musl/1003-implement-y-and-C-specifiers-in-strptime.patch64
1 files changed, 0 insertions, 64 deletions
diff --git a/main/musl/1003-implement-y-and-C-specifiers-in-strptime.patch b/main/musl/1003-implement-y-and-C-specifiers-in-strptime.patch
deleted file mode 100644
index f8c78a090f..0000000000
--- a/main/musl/1003-implement-y-and-C-specifiers-in-strptime.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-From c133ba2ee8a937ed4db438360f2f78d0a8cb9a24 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
-Date: Wed, 14 May 2014 10:53:56 +0300
-Subject: [PATCH] implement %y and %C specifiers in strptime
-
----
- src/time/strptime.c | 14 ++++++++++----
- 1 file changed, 10 insertions(+), 4 deletions(-)
-
-diff --git a/src/time/strptime.c b/src/time/strptime.c
-index 4d9eea4..f41f55f 100644
---- a/src/time/strptime.c
-+++ b/src/time/strptime.c
-@@ -11,6 +11,7 @@ char *strptime(const char *restrict s, const char *restrict f, struct tm *restri
- int i, w, neg, adj, min, range, *dest, dummy;
- const char *ex;
- size_t len;
-+ int want_century = 0, century = 0;
- while (*f) {
- if (*f != '%') {
- if (isspace(*f)) for (; *s && isspace(*s); s++);
-@@ -40,9 +41,9 @@ char *strptime(const char *restrict s, const char *restrict f, struct tm *restri
- if (!s) return 0;
- break;
- case 'C':
-- /* FIXME */
-- dest = &dummy;
-+ dest = &century;
- if (w<0) w=2;
-+ want_century |= 2;
- goto numeric_digits;
- case 'd': case 'e':
- dest = &tm->tm_mday;
-@@ -135,14 +136,15 @@ char *strptime(const char *restrict s, const char *restrict f, struct tm *restri
- if (!s) return 0;
- break;
- case 'y':
-- /* FIXME */
-- dest = &dummy;
-+ dest = &tm->tm_year;
- w = 2;
-+ want_century |= 1;
- goto numeric_digits;
- case 'Y':
- dest = &tm->tm_year;
- if (w<0) w=4;
- adj = 1900;
-+ want_century = 0;
- goto numeric_digits;
- case '%':
- if (*s++ != '%') return 0;
-@@ -187,5 +189,9 @@ char *strptime(const char *restrict s, const char *restrict f, struct tm *restri
- ;
- }
- }
-+ if (want_century) {
-+ if (want_century & 2) tm->tm_year += century * 100 - 1900;
-+ else if (tm->tm_year <= 68) tm->tm_year += 100;
-+ }
- return (char *)s;
- }
---
-1.9.3
-