ref: 7bcd5d2fc50d434a3e4da7b8fa6b8721f62ab906
parent: 4fe4b7c4bc10e8dd141f0940445e3919769af232
author: Michael Forney <mforney@mforney.org>
date: Thu May 26 16:23:11 EDT 2022
tmparse: remove incorrect isalpha definition Checking the range of c|0x60 incorrectly classifies many characters as alphabetic (digits, control characters 0x01-0x20, and punctuation characters '!'-':'). This prevents tmparse from parsing dates with a timezone bounded by those characters (for example, "12:11:56 (PDT)"). Instead, just reuse the isalpha macro provided by ctype.h.
--- a/sys/src/libc/port/date.c
+++ b/sys/src/libc/port/date.c
@@ -1,5 +1,6 @@
#include <u.h>
#include <libc.h>
+#include <ctype.h>
typedef struct Tzabbrev Tzabbrev;
typedef struct Tzoffpair Tzoffpair;
@@ -61,9 +62,6 @@
char *abbr;
int off;
};
-
-#define isalpha(c)\
- (((c)|0x60) >= 'a' && ((c)|0x60) <= 'z')
/* Obsolete time zone names. Hardcoded to match RFC5322 */
static Tzabbrev tzabbrev[] = {
--
⑨