[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-gcal] gcal must use _NL_TIME_FIRST_WEEKDAY to get correct defaults
From: |
Olaf Hering |
Subject: |
[Bug-gcal] gcal must use _NL_TIME_FIRST_WEEKDAY to get correct defaults for -s N option |
Date: |
Wed, 11 Dec 2013 17:12:21 +0100 |
User-agent: |
Mutt/1.5.22.rev6346 (2013-10-29) |
Since a very long time it bothers me alot that gcal fails to get the
starting of the week right. It may be Sunday in some parts of the World,
but for us its Monday.
So today I finally looked into the source once I figured that 3.6.3 still
fails. It turned out that gcal.c assumes a define is provided by glibc for
_NL_TIME_FIRST_WEEKDAY. But in fact its an enum, so the incorrect fallback is
used.
Please add a fix equivalent to the following:
Index: src/gcal.c
===================================================================
--- src/gcal.c.orig
+++ src/gcal.c
@@ -6023,9 +6023,10 @@ check_command_line (argc, argv)
/*
Set starting day of week to language/territory default value.
*/
-#if defined GCAL_NLS && defined _NL_TIME_FIRST_WEEKDAY
+#if defined GCAL_NLS
start_day = (nl_langinfo (_NL_TIME_FIRST_WEEKDAY)[0] + 5) % 7 + 1;
#else /* !GCAL_NLS */
+#error MUST USE _NL_TIME_FIRST_WEEKDAY !!1!
start_day = DAY_MAX;
#endif /* !GCAL_NLS */
}
Thanks for reading.
Olaf
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Bug-gcal] gcal must use _NL_TIME_FIRST_WEEKDAY to get correct defaults for -s N option,
Olaf Hering <=