forcemerge 414428 592356
tags 414428 + patch
thanks

* Christian Hammers <c...@debian.org>, 2007-03-11, 20:34:
Package: ccal
Version: 3.5-7
Severity: normal

Hello

source/cal.c#396:
   /* Note '0' is Sunday (default), '1' is Monday */
   europe = (int)(nl_langinfo(_NL_TIME_FIRST_WEEKDAY))[0];

This is indeed wrong. nl_langinfo never returns 0 here. It's either 1 (Sunday), or 2 (Monday), or, for some exotic locales, 7. The attached patch fixes this bug.

--
Jakub Wilk
diff --git a/source/cal.c b/source/cal.c
--- a/source/cal.c
+++ b/source/cal.c
@@ -394,7 +394,7 @@
     setlocale(LC_TIME, "");
 #ifdef USE_LANGINFO
     /* Note '0' is Sunday (default), '1' is Monday */ 
-    europe = (int)(nl_langinfo(_NL_TIME_FIRST_WEEKDAY))[0];
+    europe = (int)(nl_langinfo(_NL_TIME_FIRST_WEEKDAY))[0] - 1;
     if ( europe == 1 ) {
 	    dayline = Europedays;
     } else {

Reply via email to