summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2021-05-25 10:09:36 +0200
committerYorhel <git@yorhel.nl>2021-05-27 10:33:01 +0200
commitbd01f5773d0a8c6966a95a1ad6501b9f21993df9 (patch)
tree69178a50181835ce6c66978ae56ab220d93a2e7a
parent67a1d84216a4cd00dd32c32575a90f00cf00aa15 (diff)
JSON import: accept fractional mtime values
For sub-second precision, if we ever want to add that.
-rw-r--r--src/dir_import.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/dir_import.c b/src/dir_import.c
index 287a381..ed5dbe2 100644
--- a/src/dir_import.c
+++ b/src/dir_import.c
@@ -465,6 +465,12 @@ static int iteminfo(void) {
C(rint64(&iv, UINT64_MAX));
ctx->buf_dir->flags |= FF_EXT;
ctx->buf_ext->mtime = iv;
+ // Accept decimal numbers, but discard the fractional part because our data model doesn't support it.
+ if(*ctx->buf == '.') {
+ con(1);
+ while(*ctx->buf >= '0' && *ctx->buf <= '9')
+ con(1);
+ }
} else if(strcmp(ctx->val, "hlnkc") == 0) { /* hlnkc */
if(*ctx->buf == 't') {
C(rlit("true", 4));