If only the year operand is given, cal shall produce a calendar for all twelve months in the given calendar year.
This commit is contained in:
11
cal.c
11
cal.c
@@ -146,7 +146,7 @@ main(int argc, char *argv[])
|
||||
fday = 0;
|
||||
|
||||
ncols = 3;
|
||||
nmons = 1;
|
||||
nmons = 0;
|
||||
|
||||
ARGBEGIN {
|
||||
case '1':
|
||||
@@ -183,6 +183,15 @@ main(int argc, char *argv[])
|
||||
usage();
|
||||
} ARGEND;
|
||||
|
||||
if (nmons == 0) {
|
||||
if (argc == 1) {
|
||||
month = 1;
|
||||
nmons = 12;
|
||||
} else {
|
||||
nmons = 1;
|
||||
}
|
||||
}
|
||||
|
||||
switch (argc) {
|
||||
case 2:
|
||||
month = estrtol(argv[0], 0);
|
||||
|
Reference in New Issue
Block a user