summaryrefslogtreecommitdiffstats
path: root/misc-utils/cal.c
diff options
context:
space:
mode:
authorRafal Luzynski2017-03-21 09:27:08 +0100
committerRafal Luzynski2018-01-22 11:50:50 +0100
commit4e12a62e884441dbce62d3bd38108022e93e25c6 (patch)
treef9d717fd7d8885c5a8cd783f823c6359c9f2cbab /misc-utils/cal.c
parentcal: fix julian calendars for large years (diff)
downloadkernel-qcow2-util-linux-4e12a62e884441dbce62d3bd38108022e93e25c6.tar.gz
kernel-qcow2-util-linux-4e12a62e884441dbce62d3bd38108022e93e25c6.tar.xz
kernel-qcow2-util-linux-4e12a62e884441dbce62d3bd38108022e93e25c6.zip
cal: Use ALTMON_* correctly
cal: use ALTMON_* and _NL_ABALTMON_* constants to display months in a standalone form correctly. These constants have just been newly added to glibc. ALTMON_x has been used in BSD family since 1990s and has been accepted as the future POSIX extension. _NL_ABALTMON_* is exclusively a GNU extension but it is expected to be added to POSIX in future. More info: https://sourceware.org/bugzilla/show_bug.cgi?id=10871
Diffstat (limited to 'misc-utils/cal.c')
-rw-r--r--misc-utils/cal.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/misc-utils/cal.c b/misc-utils/cal.c
index a854eaf9d..c2e2913e7 100644
--- a/misc-utils/cal.c
+++ b/misc-utils/cal.c
@@ -574,7 +574,7 @@ static void init_monthnames(struct cal_control *ctl)
return; /* already initialized */
for (i = 0; i < MONTHS_IN_YEAR; i++)
- ctl->full_month[i] = nl_langinfo(MON_1 + i);
+ ctl->full_month[i] = nl_langinfo(ALTMON_1 + i);
}
static void init_abbr_monthnames(struct cal_control *ctl)
@@ -585,7 +585,7 @@ static void init_abbr_monthnames(struct cal_control *ctl)
return; /* already initialized */
for (i = 0; i < MONTHS_IN_YEAR; i++)
- ctl->abbr_month[i] = nl_langinfo(ABMON_1 + i);
+ ctl->abbr_month[i] = nl_langinfo(_NL_ABALTMON_1 + i);
}
static int monthname_to_number(struct cal_control *ctl, const char *name)