aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-07-22 10:10:13 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-07-22 10:10:13 +0000
commita5254032f57627fa3b9b9acebc6bdd0a6e02955f (patch)
tree935810c06a4025db9a9e509094b102ebf9e205c0 /coreutils
parentb62bd7b261bbfadcaeb7c5fcec8b4921bf5379a6 (diff)
downloadbusybox-a5254032f57627fa3b9b9acebc6bdd0a6e02955f.tar.gz
cal: remove lone static data variable. -4 bytes. coreutils
is down to four applets with nonzero data+bss.
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/cal.c8
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 = {
24, 25, 26, 27, 28, 29, 30
};
-static unsigned julian;
+/* Set to 0 or 1 in main */
+#define julian ((unsigned)option_mask32)
/* leap year -- account for Gregorian reformation in 1752 */
static int leap_year(unsigned yr)
@@ -87,7 +88,8 @@ int cal_main(int argc, char **argv)
char buf[40];
flags = getopt32(argv, "jy");
- julian = flags & 1;
+ /* This sets julian = flags & 1: */
+ option_mask32 &= 1;
month = 0;
argv += optind;
argc -= optind;
@@ -100,7 +102,7 @@ int cal_main(int argc, char **argv)
time(&now);
local_time = localtime(&now);
year = local_time->tm_year + 1900;
- if (!(flags & 2)) {
+ if (!(flags & 2)) { /* no -y */
month = local_time->tm_mon + 1;
}
} else {