Critical gnome-libs 1.4.1.7 bug + fix



I'm not 100% sure how to commit this to the stable branch.  We're not yet using
GNOME 2.x.

The following change from 1.4.1.6 was incorrect:

	gtk_calendar_get_date (calendar, &year, &month, &day);

-	/* FIXME: internationalize this - strftime()*/
-	g_snprintf (buffer, sizeof(buffer), "%d/%d/%d", month + 1, day, year);
+	date = g_date_new_dmy (day, month, year);

This results in the month getting decremented every time the user accesses the
calendar widget, and when month becomes zero or if it's January the widget is
blanked and the following critical errors are output:

GLib-CRITICAL **: file gdate.c: line 55 (g_date_new_dmy): assertion `g_date_valid_dmy (day, m, y)' failed.

GLib-CRITICAL **: file gdate.c: line 1277 (g_date_strftime): assertion `d != NULL' failed.

GLib-CRITICAL **: file gdate.c: line 92 (g_date_free): assertion `d != NULL' failed.

Reproduce with gnomecal: Edit->New appointment...->Calendar.

Here is the one liner:

--- gnome-libs-1.4.1.7/libgnomeui/gnome-dateedit.c.orig	Fri Jul 12 22:25:59 2002
+++ gnome-libs-1.4.1.7/libgnomeui/gnome-dateedit.c	Fri Jul 12 22:26:53 2002
@@ -80,7 +80,7 @@
 
 	gtk_calendar_get_date (calendar, &year, &month, &day);
 
-	date = g_date_new_dmy (day, month, year);
+	date = g_date_new_dmy (day, month + 1, year);
 	g_date_strftime (buffer, sizeof(buffer), "%x", date);
 	g_date_free (date);
 

Please commit and release a 1.4.1.8, if possible.

John

-- 
John GOTTS <jgotts linuxsavvy com>  http://linuxsavvy.com/staff/jgotts



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]