No shipping version of Android has %F.
---
 lib/xwrap.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
From 7db59724c16ee35e541136b623d4d4845ffd6027 Mon Sep 17 00:00:00 2001
From: Elliott Hughes <[email protected]>
Date: Tue, 26 Mar 2019 11:23:51 -0700
Subject: [PATCH] xparsedate: don't use GNU extensions missing on Android.

No shipping version of Android has %F.
---
 lib/xwrap.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lib/xwrap.c b/lib/xwrap.c
index ee07fda2..0806eff5 100644
--- a/lib/xwrap.c
+++ b/lib/xwrap.c
@@ -964,8 +964,8 @@ void xparsedate(char *str, time_t *t, unsigned *nano)
   time_t now = *t;
   int len = 0, i;
   // Formats with years must come first.
-  char *s = str, *p, *formats[] = {"%F %T", "%FT%T", "%F %H:%M", "%F",
-    "%H:%M:%S", "%H:%M"};
+  char *s = str, *p, *formats[] = {"%Y-%m-%d %T", "%Y-%m-%dT%T",
+    "%Y-%m-%d %H:%M", "%Y-%m-%d", "%H:%M:%S", "%H:%M"};
 
   *nano = 0;
 
@@ -1049,6 +1049,5 @@ void xparsedate(char *str, time_t *t, unsigned *nano)
   if (!*s) return;
 
 bad_dates:
-  // monkey died
   xvali_date(0, str);
 }
-- 
2.21.0.392.gf8f6787159e-goog

_______________________________________________
Toybox mailing list
[email protected]
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to