- Fix the highlighting for non-terminals when the last week is not
7 days long. - "-m <N> <YYYY>" now prints only the month, not the whole year.
This commit is contained in:
parent
102c07edb3
commit
1d0e1dac57
@ -169,3 +169,6 @@ command and manual were written by
|
|||||||
.Sh BUGS
|
.Sh BUGS
|
||||||
The assignment of Julian\(enGregorian switching dates to country
|
The assignment of Julian\(enGregorian switching dates to country
|
||||||
codes is historically naive for many countries.
|
codes is historically naive for many countries.
|
||||||
|
.Pp
|
||||||
|
Not all options are compatible and using them in different orders
|
||||||
|
will give varying results.
|
||||||
|
@ -60,7 +60,7 @@ struct monthlines {
|
|||||||
wchar_t name[MAX_WIDTH + 1];
|
wchar_t name[MAX_WIDTH + 1];
|
||||||
char lines[7][MAX_WIDTH + 1];
|
char lines[7][MAX_WIDTH + 1];
|
||||||
char weeks[MAX_WIDTH + 1];
|
char weeks[MAX_WIDTH + 1];
|
||||||
unsigned int linelen[7];
|
unsigned int extralen[7];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct weekdays {
|
struct weekdays {
|
||||||
@ -290,6 +290,8 @@ main(int argc, char *argv[])
|
|||||||
break;
|
break;
|
||||||
case 'm':
|
case 'm':
|
||||||
flag_month = optarg;
|
flag_month = optarg;
|
||||||
|
before = 0;
|
||||||
|
after = 0;
|
||||||
break;
|
break;
|
||||||
case 'o':
|
case 'o':
|
||||||
if (flag_backward)
|
if (flag_backward)
|
||||||
@ -336,14 +338,19 @@ main(int argc, char *argv[])
|
|||||||
if (flag_easter)
|
if (flag_easter)
|
||||||
usage();
|
usage();
|
||||||
flag_month = *argv++;
|
flag_month = *argv++;
|
||||||
|
before = 0;
|
||||||
|
after = 0;
|
||||||
|
m = strtol(flag_month, NULL, 10);
|
||||||
/* FALLTHROUGH */
|
/* FALLTHROUGH */
|
||||||
case 1:
|
case 1:
|
||||||
y = atoi(*argv++);
|
y = atoi(*argv++);
|
||||||
if (y < 1 || y > 9999)
|
if (y < 1 || y > 9999)
|
||||||
errx(EX_USAGE, "year %d not in range 1..9999", y);
|
errx(EX_USAGE, "year %d not in range 1..9999", y);
|
||||||
|
if (before == -1 && after == -1) {
|
||||||
before = 0;
|
before = 0;
|
||||||
after = 11;
|
after = 11;
|
||||||
m = 1;
|
m = 1;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 0:
|
case 0:
|
||||||
{
|
{
|
||||||
@ -470,8 +477,7 @@ printeaster(int y, int julian, int orthodox)
|
|||||||
printf("%s\n", buf);
|
printf("%s\n", buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MW(mw, ms, ml) \
|
#define MW(mw, me) ((mw) + me)
|
||||||
strlen(ms) > (ml) ? (mw) + 9 : (mw)
|
|
||||||
#define DECREASEMONTH(m, y) \
|
#define DECREASEMONTH(m, y) \
|
||||||
if (--m == 0) { \
|
if (--m == 0) { \
|
||||||
m = 12; \
|
m = 12; \
|
||||||
@ -564,7 +570,9 @@ monthrangeb(int y, int jd_flag, int m, int before, int after)
|
|||||||
|
|
||||||
for (i = 0; i != 6; i++) {
|
for (i = 0; i != 6; i++) {
|
||||||
for (j = 0; j < count; j++)
|
for (j = 0; j < count; j++)
|
||||||
printf("%-*s ", mw, year[j].lines[i]+1);
|
printf("%-*s ",
|
||||||
|
MW(mw, year[j].extralen[i]),
|
||||||
|
year[j].lines[i]+1);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -641,8 +649,8 @@ monthranger(int y, int jd_flag, int m, int before, int after)
|
|||||||
/* Full months */
|
/* Full months */
|
||||||
for (j = 0; j < count; j++)
|
for (j = 0; j < count; j++)
|
||||||
printf("%-*s",
|
printf("%-*s",
|
||||||
MW(mw, year[j].lines[i],
|
MW(mw, year[j].extralen[i]),
|
||||||
year[j].linelen[i]), year[j].lines[i]);
|
year[j].lines[i]);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -733,7 +741,7 @@ mkmonthr(int y, int m, int jd_flag, struct monthlines *mlines)
|
|||||||
memcpy(mlines->lines[i] + k + l, " ", dw);
|
memcpy(mlines->lines[i] + k + l, " ", dw);
|
||||||
}
|
}
|
||||||
mlines->lines[i][k + l] = '\0';
|
mlines->lines[i][k + l] = '\0';
|
||||||
mlines->linelen[i] = k;
|
mlines->extralen[i] = l;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* fill the weeknumbers */
|
/* fill the weeknumbers */
|
||||||
@ -840,6 +848,7 @@ mkmonthb(int y, int m, int jd_flag, struct monthlines *mlines)
|
|||||||
mlines->lines[i][1] = '\0';
|
mlines->lines[i][1] = '\0';
|
||||||
else
|
else
|
||||||
mlines->lines[i][k + l] = '\0';
|
mlines->lines[i][k + l] = '\0';
|
||||||
|
mlines->extralen[i] = l;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user