summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorPaul Janzen <pjanzen@cvs.openbsd.org>1999-11-25 03:46:48 +0000
committerPaul Janzen <pjanzen@cvs.openbsd.org>1999-11-25 03:46:48 +0000
commit31987f4aca72feedf37382b24fa360a85edec1e8 (patch)
treeca39be191f17cf530d48ccc2344c0cc91f14add4 /usr.bin
parent29ac641b4f3110c34231826cb9e4444e6c777cca (diff)
Parse dates only before the first <tab> character; otherwise, weekly events
whose description starts with a valid month are misparsed.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/calendar/day.c10
-rw-r--r--usr.bin/calendar/io.c8
2 files changed, 9 insertions, 9 deletions
diff --git a/usr.bin/calendar/day.c b/usr.bin/calendar/day.c
index 717c2d083cc..ca67749e11f 100644
--- a/usr.bin/calendar/day.c
+++ b/usr.bin/calendar/day.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: day.c,v 1.9 1999/04/25 01:16:04 pjanzen Exp $ */
+/* $OpenBSD: day.c,v 1.10 1999/11/25 03:46:46 pjanzen Exp $ */
/*
* Copyright (c) 1989, 1993, 1994
@@ -43,7 +43,7 @@ static const char copyright[] =
#if 0
static const char sccsid[] = "@(#)calendar.c 8.3 (Berkeley) 3/25/94";
#else
-static char rcsid[] = "$OpenBSD: day.c,v 1.9 1999/04/25 01:16:04 pjanzen Exp $";
+static char rcsid[] = "$OpenBSD: day.c,v 1.10 1999/11/25 03:46:46 pjanzen Exp $";
#endif
#endif /* not lint */
@@ -248,9 +248,9 @@ time_t Mktime (date)
* 3-charweekday (Friday, Monday, mon.)
* numeric month or day (1, 2, 04)
*
- * Any character may separate them, or they may not be separated. Any line,
- * following a line that is matched, that starts with "whitespace", is shown
- * along with the matched line.
+ * Any character except \t or '*' may separate them, or they may not be
+ * separated. Any line following a line that is matched, that starts
+ * with \t, is shown along with the matched line.
*/
struct match *
isnow(endp)
diff --git a/usr.bin/calendar/io.c b/usr.bin/calendar/io.c
index 6c05544dfaa..9b4bfb06198 100644
--- a/usr.bin/calendar/io.c
+++ b/usr.bin/calendar/io.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: io.c,v 1.7 1999/04/20 23:03:25 pjanzen Exp $ */
+/* $OpenBSD: io.c,v 1.8 1999/11/25 03:46:47 pjanzen Exp $ */
/*
* Copyright (c) 1989, 1993, 1994
@@ -43,7 +43,7 @@ static const char copyright[] =
#if 0
static const char sccsid[] = "@(#)calendar.c 8.3 (Berkeley) 3/25/94";
#else
-static char rcsid[] = "$OpenBSD: io.c,v 1.7 1999/04/20 23:03:25 pjanzen Exp $";
+static char rcsid[] = "$OpenBSD: io.c,v 1.8 1999/11/25 03:46:47 pjanzen Exp $";
#endif
#endif /* not lint */
@@ -207,7 +207,7 @@ getfield(p, endp, flags)
int val, var, i;
char *start, savech;
- for (; !isdigit(*p) && !isalpha(*p) && *p != '*'; ++p)
+ for (; !isdigit(*p) && !isalpha(*p) && *p != '*' && *p != '\t'; ++p)
;
if (*p == '*') { /* `*' is every month */
*flags |= F_ISMONTH;
@@ -286,7 +286,7 @@ getfield(p, endp, flags)
return (0);
}
}
- for (*p = savech; !isdigit(*p) && !isalpha(*p) && *p != '*'; ++p)
+ for (*p = savech; !isdigit(*p) && !isalpha(*p) && *p != '*' && *p != '\t'; ++p)
;
*endp = p;
return (val);