summaryrefslogtreecommitdiff
path: root/misc/astrolog/files/patch-general.c
diff options
context:
space:
mode:
authorAdam Weinberger <adamw@FreeBSD.org>2014-07-29 01:16:45 +0000
committerAdam Weinberger <adamw@FreeBSD.org>2014-07-29 01:16:45 +0000
commit0d36ec3c7937d274f501258ddf1798b05e4f33c2 (patch)
treeb35c705d3b36af5129c9a15430528661add3b428 /misc/astrolog/files/patch-general.c
parentStage net-mgmt/routers2-extras and cleanup (diff)
Rename misc/ patch-xy patches to reflect the files they modify.
Notes
Notes: svn path=/head/; revision=363282
Diffstat (limited to 'misc/astrolog/files/patch-general.c')
-rw-r--r--misc/astrolog/files/patch-general.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/misc/astrolog/files/patch-general.c b/misc/astrolog/files/patch-general.c
new file mode 100644
index 000000000000..faaf547d22bc
--- /dev/null
+++ b/misc/astrolog/files/patch-general.c
@@ -0,0 +1,47 @@
+--- general.c.orig 2002-04-27 22:33:57.000000000 +0400
++++ general.c 2012-02-26 11:13:09.000000000 +0400
+@@ -900,14 +900,32 @@
+
+ /* Return a string containing the given time zone, given as a real value */
+ /* having the hours before GMT in the integer part and minutes fractionally. */
++/* Seconds are printed when needed. */
+
+ byte *SzZone(zon)
+ real zon;
+ {
+- static byte szZon[7];
++ static byte szZon[10];
++ int hr, min, sec;
++ real rMin;
+
+- sprintf(szZon, "%c%d:%02d", zon > 0.0 ? '-' : '+', (int)RAbs(zon),
+- (int)(RFract(RAbs(zon))*100.0+rRound/60.0));
++ hr = NFloor(RAbs(zon));
++ rMin = RFract(RAbs(zon)) * 100.0;
++ min = (int)(rMin + rRound / 600.0);
++ rFractal = RFract(rMin);
++ if (rFractal > rOne)
++ rFractal = rSmall;
++ sec = (int)(60.0*rFractal + rRound);
++ while (min >= 60) {
++ min -= 60;
++ hr++;
++ }
++ while (hr >= 24)
++ hr -= 24;
++ if (sec == 0)
++ sprintf(szZon, "%c%d:%02d", zon > 0.0 ? '-' : '+', hr, min);
++ else
++ sprintf(szZon, "%c%d:%02d:%02d", zon > 0.0 ? '-' : '+', hr, min, sec);
+ return szZon;
+ }
+
+@@ -970,7 +988,7 @@
+ int *mon, *day, *yea;
+ real *tim, zon;
+ {
+- dword curtimer;
++ time_t curtimer;
+ int min, sec;
+ real hr;
+