aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2017-09-19 07:09:05 +0000
committerNIIBE Yutaka <[email protected]>2017-09-19 07:09:05 +0000
commitba8afc4966cca1f6aaf9b2a9bfc3220782306c2b (patch)
treefb1d2090ee7c024c1863b21939b89d9d9e662e7e
parentcommon: Fix gnupg_wait_processes. (diff)
downloadgnupg-ba8afc4966cca1f6aaf9b2a9bfc3220782306c2b.tar.gz
gnupg-ba8afc4966cca1f6aaf9b2a9bfc3220782306c2b.zip
common: Accept the Z-suffix for yymmddThhmmssZ format.
* common/gettime.c (isotime_p): Accept the Z suffix. -- The intention is use for human interface. GnuPG-bug-id: 3278 Signed-off-by: NIIBE Yutaka <[email protected]>
-rw-r--r--common/gettime.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/common/gettime.c b/common/gettime.c
index 3e1ee5569..4ad99f54d 100644
--- a/common/gettime.c
+++ b/common/gettime.c
@@ -222,6 +222,8 @@ isotime_p (const char *string)
for (s++, i=9; i < 15; i++, s++)
if (!digitp (s))
return 0;
+ if (*s == 'Z')
+ s++;
if ( !(!*s || (isascii (*s) && isspace(*s)) || *s == ':' || *s == ','))
return 0; /* Wrong delimiter. */
@@ -354,9 +356,10 @@ string2isotime (gnupg_isotime_t atime, const char *string)
}
-/* Scan an ISO timestamp and return an Epoch based timestamp. The only
- supported format is "yyyymmddThhmmss" delimited by white space, nul, a
- colon or a comma. Returns (time_t)(-1) for an invalid string. */
+/* Scan an ISO timestamp and return an Epoch based timestamp. The
+ only supported format is "yyyymmddThhmmss[Z]" delimited by white
+ space, nul, a colon or a comma. Returns (time_t)(-1) for an
+ invalid string. */
time_t
isotime2epoch (const char *string)
{