ref: 9afa5550f7497f84fb157ba07ff94301dbe06bcc
parent: eb6b1e672c33a9dce0de368a0e954b801f2035d3
author: Ori Bernstein <[email protected]>
date: Fri Sep 25 17:22:47 EDT 2020
tmdate(1): fix missing arg, fix formatting (thanks joe9)
--- a/sys/man/2/tmdate
+++ b/sys/man/2/tmdate
@@ -224,15 +224,17 @@
.EX
#define Fmt "?WWW, ?MM ?DD hh:mm:ss ?Z YYYY"
Tm a, b;
-char *e;
+char *e, *est, *pst;
-if(tmparse(&a, Fmt, "Tue Dec 10 12:36:00 PST 2019", &e) == nil)
+pst = "Tue Dec 10 12:36:00 PST 2019";
+est = "Tue Dec 10 15:36:00 EST 2019";
+f(tmparse(&a, Fmt, pst, nil, &e) == nil)
sysfatal("failed to parse: %r");
-if(*e != '\0')
+if(*e != '\\0')
sysfatal("trailing junk %s", e);
-if(tmparse(&b, Fmt, "Tue Dec 10 15:36:00 EST 2019", &e) == nil)
+if(tmparse(&b, Fmt, est, nil, &e) == nil)
sysfatal("failed to parse: %r");
-if(*e != '\0')
+if(*e != '\\0')
sysfatal("trailing junk %s", e);
if(tmnorm(a) == tmnorm(b) && a.nsec == b.nsec)
print("same\\n");