diff options
author | John Polstra <jdp@FreeBSD.org> | 1996-07-19 00:44:55 +0000 |
---|---|---|
committer | John Polstra <jdp@FreeBSD.org> | 1996-07-19 00:44:55 +0000 |
commit | 9b2ea11c98d609db38eeb3f86e08ab2e54baa9ed (patch) | |
tree | 2de9a6320c1af67aa71bb1ec85add8289b471804 /usr.bin/at | |
parent | de88f1607c62bbc0b40586c3f5dce383c88b2049 (diff) | |
download | src-9b2ea11c98d609db38eeb3f86e08ab2e54baa9ed.tar.gz src-9b2ea11c98d609db38eeb3f86e08ab2e54baa9ed.zip |
Notes
Diffstat (limited to 'usr.bin/at')
-rw-r--r-- | usr.bin/at/parsetime.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/usr.bin/at/parsetime.c b/usr.bin/at/parsetime.c index a54e7f0aed44..50c7137803d8 100644 --- a/usr.bin/at/parsetime.c +++ b/usr.bin/at/parsetime.c @@ -130,7 +130,7 @@ static size_t sc_len; /* scanner - lenght of token buffer */ static int sc_tokid; /* scanner - token id */ static int sc_tokplur; /* scanner - is token plural? */ -static char rcsid[] = "$Id: parsetime.c,v 1.1 1995/05/24 15:07:32 ig25 Exp $"; +static char rcsid[] = "$Id: parsetime.c,v 1.6 1995/08/21 12:32:50 ache Exp $"; /* Local functions */ @@ -367,8 +367,13 @@ tod(struct tm *tm) if (hour > 12) panic("garbled time"); - if (sc_tokid == PM) - hour += 12; + if (sc_tokid == PM) { + if (hour != 12) /* 12:xx PM is 12:xx, not 24:xx */ + hour += 12; + } else { + if (hour == 12) /* 12:xx AM is 00:xx, not 12:xx */ + hour -= 12; + } token(); } else if (hour > 23) |