summaryrefslogtreecommitdiffstats
path: root/src/cmd/acme/acme.c
diff options
context:
space:
mode:
authorRuss Cox <russcox@gmail.com>2009-09-25 01:43:54 -0400
committerRuss Cox <russcox@gmail.com>2009-09-25 01:43:54 -0400
commitdaea2c7d501c3e825bede80992ade6b241efdce1 (patch)
tree7b222116d5eb48265654660917dbd0b5be630fcc /src/cmd/acme/acme.c
parent1961ee822320bdc107e55f10b2db1bfe8f70d382 (diff)
downloadplan9port-daea2c7d501c3e825bede80992ade6b241efdce1.tar.gz
plan9port-daea2c7d501c3e825bede80992ade6b241efdce1.zip
acme: correct modified message after initial load; more detail in
message http://codereview.appspot.com/123051
Diffstat (limited to 'src/cmd/acme/acme.c')
-rw-r--r--src/cmd/acme/acme.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/cmd/acme/acme.c b/src/cmd/acme/acme.c
index ed8307e1..740f3617 100644
--- a/src/cmd/acme/acme.c
+++ b/src/cmd/acme/acme.c
@@ -19,7 +19,8 @@ void keyboardthread(void*);
void waitthread(void*);
void xfidallocthread(void*);
void newwindowthread(void*);
-void plumbproc(void*);
+void plumbproc(void*);
+int timefmt(Fmt*);
Reffont **fontcache;
int nfontcache;
@@ -127,6 +128,8 @@ threadmain(int argc, char *argv[])
fontnames[1] = estrdup(fontnames[1]);
quotefmtinstall();
+ fmtinstall('t', timefmt);
+
cputype = getenv("cputype");
objtype = getenv("objtype");
home = getenv("HOME");
@@ -1067,3 +1070,14 @@ ismtpt(char *file)
n = strlen(mtpt);
return strncmp(file, mtpt, n) == 0 && ((n > 0 && mtpt[n-1] == '/') || file[n] == '/' || file[n] == 0);
}
+
+int
+timefmt(Fmt *f)
+{
+ Tm *tm;
+
+ tm = localtime(va_arg(f->args, ulong));
+ return fmtprint(f, "%04d/%02d/%02d %02d:%02d:%02d",
+ tm->year+1900, tm->mon+1, tm->mday, tm->hour, tm->min, tm->sec);
+}
+