summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>1997-10-07 06:11:12 +0000
committerobrien <obrien@FreeBSD.org>1997-10-07 06:11:12 +0000
commit3c0102e62cfc218f16a9f8a70950568f3c2bc3ad (patch)
treeaed4cf134e8bb7c3e09c7d37d2f97866f6cb14d9
parentff6ccf5344e9de33e25fd33d667db0ec47f7eb4d (diff)
downloadFreeBSD-ports-3c0102e62cfc218f16a9f8a70950568f3c2bc3ad.zip
FreeBSD-ports-3c0102e62cfc218f16a9f8a70950568f3c2bc3ad.tar.gz
Patch to output time in 12hr format (ie, 11:00pm is "11:00" rather than
"23:00") if ``-12hr'' is specified.
-rw-r--r--x11-clocks/mouseclock/files/patch-0139
1 files changed, 39 insertions, 0 deletions
diff --git a/x11-clocks/mouseclock/files/patch-01 b/x11-clocks/mouseclock/files/patch-01
new file mode 100644
index 0000000..00b230a
--- /dev/null
+++ b/x11-clocks/mouseclock/files/patch-01
@@ -0,0 +1,39 @@
+--- mouseclock.c.orig Sun May 5 09:47:18 1996
++++ mouseclock.c Mon Oct 6 23:09:43 1997
+@@ -31,6 +31,7 @@
+ Window Root;
+ int shadow_size = 2;
+ int shadow_mode = 1;
++int ampm = 0;
+
+ /* ---------------------------------------------------------------- */
+ void
+@@ -56,6 +57,7 @@
+ printf ("-display <dpy> display name\n");
+ printf ("-fg <color> foreground color\n");
+ printf ("-fn <font_name> font to use\n");
++ printf ("-12hr use 12-hour format\n");
+
+ exit (1);
+ }
+@@ -266,6 +268,11 @@
+ shadow_mode = 0;
+ continue;
+ }
++ if (!strcmp ("-12hr", argv[i]))
++ {
++ ampm = 1;
++ continue;
++ }
+ usage (argv[0]);
+ }
+
+@@ -295,7 +302,7 @@
+ struct tm *now_tm = localtime (&now);
+ Cursor cur;
+
+- h = now_tm->tm_hour;
++ h = ampm && (now_tm->tm_hour - 12 > 0) ? now_tm->tm_hour - 12 : now_tm->tm_hour;
+ m = now_tm->tm_min;
+
+ if (h != last_h || m != last_m)
OpenPOWER on IntegriCloud