summaryrefslogtreecommitdiffstats
path: root/bin/date
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>1999-04-25 21:13:34 +0000
committerimp <imp@FreeBSD.org>1999-04-25 21:13:34 +0000
commit321c551969cc862a859c9e79c8404af90c94e81d (patch)
tree5ede02d61e978d083db7e7833d1560584b758dc1 /bin/date
parent4be4456eab17cc243bba5d62ce59ba675507482b (diff)
downloadFreeBSD-src-321c551969cc862a859c9e79c8404af90c94e81d.zip
FreeBSD-src-321c551969cc862a859c9e79c8404af90c94e81d.tar.gz
First set of fixes to keep egcs happy. These include {} around single
statement if blocks[*] when the else could be ambiguous, not defaulting to int type and removal of some unused variables. [*] This is explicitly allowed by style(9) when the single statement spans more than one line. Reviewed by: obrien, chuckr
Diffstat (limited to 'bin/date')
-rw-r--r--bin/date/vary.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/bin/date/vary.c b/bin/date/vary.c
index d2345d4..0e82722 100644
--- a/bin/date/vary.c
+++ b/bin/date/vary.c
@@ -26,7 +26,7 @@
#ifndef lint
static const char rcsid[] =
- "$Id: vary.c,v 1.4 1998/05/06 06:51:20 charnier Exp $";
+ "$Id: vary.c,v 1.5 1999/03/09 09:38:54 brian Exp $";
#endif /* not lint */
#include <time.h>
@@ -140,11 +140,12 @@ adjmon(struct tm *t, char type, int val, int istext)
switch (type) {
case '+':
- if (istext)
+ if (istext) {
if (val <= t->tm_mon)
val += 11 - t->tm_mon; /* early next year */
else
val -= t->tm_mon + 1; /* later this year */
+ }
if (!adjyear(t, '+', (t->tm_mon + val) / 12))
return 0;
val %= 12;
@@ -154,11 +155,12 @@ adjmon(struct tm *t, char type, int val, int istext)
break;
case '-':
- if (istext)
+ if (istext) {
if (val-1 > t->tm_mon)
val = 13 - val + t->tm_mon; /* later last year */
else
val = t->tm_mon - val + 1; /* early this year */
+ }
if (!adjyear(t, '-', val / 12))
return 0;
val %= 12;
OpenPOWER on IntegriCloud