From b7b077375fbb2cd99ca14b95545f111f47a30ca0 Mon Sep 17 00:00:00 2001 From: Ori Bernstein Date: Thu, 27 Aug 2020 10:32:02 -0700 Subject: [PATCH] faces(1): remove bespoke date parser In addition to being more code, this date parser would treat local times as local, but anything that wasn't a local time would get parsed as gmt, due to a quirk of how tm2sec used to work. This moves the code to tmparse, and fixes timezone parsing at the same time. --- sys/src/cmd/faces/plumb.c | 85 +++++++++++---------------------------- 1 file changed, 23 insertions(+), 62 deletions(-) diff --git a/sys/src/cmd/faces/plumb.c b/sys/src/cmd/faces/plumb.c index 54abbff9f..17d790701 100644 --- a/sys/src/cmd/faces/plumb.c +++ b/sys/src/cmd/faces/plumb.c @@ -140,69 +140,30 @@ getline(char *buf, int n) return buf; } -static char* months[] = { - "jan", "feb", "mar", "apr", - "may", "jun", "jul", "aug", - "sep", "oct", "nov", "dec" -}; - -static int -getmon(char *s) -{ - int i; - - for(i=0; i