PATCH: gnome-desktop



This patch checks for NULL before g_strchomp-ing a value in
gnome-desktop-item. Without it, I get 9 billion warnings when running
control center. May I commit?

-- Richard


? test-ditem-edit
? ditem.patch
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gnome-desktop/libgnome-desktop/ChangeLog,v
retrieving revision 1.73
diff -u -r1.73 ChangeLog
--- ChangeLog	1 Mar 2002 00:34:07 -0000	1.73
+++ ChangeLog	12 Mar 2002 03:00:02 -0000
@@ -1,3 +1,7 @@
+2002-03-11  Richard Hestilow  <hestilow ximian com>
+
+	* gnome-desktop-item.c (insert_key): Only chomp if val != NULL.
+
 2002-02-28  Darin Adler  <darin bentspoon com>
 
 	* gnome-desktop-item.c: (insert_key): Chomp trailing spaces
Index: gnome-desktop-item.c
===================================================================
RCS file: /cvs/gnome/gnome-desktop/libgnome-desktop/gnome-desktop-item.c,v
retrieving revision 1.93
diff -u -r1.93 gnome-desktop-item.c
--- gnome-desktop-item.c	1 Mar 2002 00:34:07 -0000	1.93
+++ gnome-desktop-item.c	12 Mar 2002 03:00:14 -0000
@@ -2841,13 +2841,14 @@
 			return;
 		}
 		val = decode_string (value, encoding, locale);
-		g_strchomp (val);
 
 		/* Ignore this key, it's whacked */
 		if (val == NULL) {
 			g_free (locale);
 			return;
 		}
+		else
+			g_strchomp (val);
 
 		/* For old KDE entries, we can also split by a comma
 		 * on sort order, so convert to semicolons */


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