diff options
-rw-r--r-- | coreutils/cal.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/coreutils/cal.c b/coreutils/cal.c index 8a93057b0..9b597772e 100644 --- a/coreutils/cal.c +++ b/coreutils/cal.c | |||
@@ -40,7 +40,8 @@ static const unsigned char sep1752[] ALIGN1 = { | |||
40 | 24, 25, 26, 27, 28, 29, 30 | 40 | 24, 25, 26, 27, 28, 29, 30 |
41 | }; | 41 | }; |
42 | 42 | ||
43 | static unsigned julian; | 43 | /* Set to 0 or 1 in main */ |
44 | #define julian ((unsigned)option_mask32) | ||
44 | 45 | ||
45 | /* leap year -- account for Gregorian reformation in 1752 */ | 46 | /* leap year -- account for Gregorian reformation in 1752 */ |
46 | static int leap_year(unsigned yr) | 47 | static int leap_year(unsigned yr) |
@@ -87,7 +88,8 @@ int cal_main(int argc, char **argv) | |||
87 | char buf[40]; | 88 | char buf[40]; |
88 | 89 | ||
89 | flags = getopt32(argv, "jy"); | 90 | flags = getopt32(argv, "jy"); |
90 | julian = flags & 1; | 91 | /* This sets julian = flags & 1: */ |
92 | option_mask32 &= 1; | ||
91 | month = 0; | 93 | month = 0; |
92 | argv += optind; | 94 | argv += optind; |
93 | argc -= optind; | 95 | argc -= optind; |
@@ -100,7 +102,7 @@ int cal_main(int argc, char **argv) | |||
100 | time(&now); | 102 | time(&now); |
101 | local_time = localtime(&now); | 103 | local_time = localtime(&now); |
102 | year = local_time->tm_year + 1900; | 104 | year = local_time->tm_year + 1900; |
103 | if (!(flags & 2)) { | 105 | if (!(flags & 2)) { /* no -y */ |
104 | month = local_time->tm_mon + 1; | 106 | month = local_time->tm_mon + 1; |
105 | } | 107 | } |
106 | } else { | 108 | } else { |