[evolution-patches] 43878, 43727: escaped chars in filenames cause load failures



So, fejj and I slogged through this and through some simple tests and
further code inspection determined that libxml2 is treating filenames
passed to xmlParseFile as if they were urls.  Passing a %xx sequence in
a filename causes libxml2 to attempt to open the hex-decoded name which
doesn't exist, print warnings, and generally not do what we asked it to
do.

This patch substitutes '%' chars with '_' like we do for other "unsafe"
chars already.

Mike
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gal/ChangeLog,v
retrieving revision 1.783
diff -u -p -r1.783 ChangeLog
--- ChangeLog	30 May 2003 16:10:52 -0000	1.783
+++ ChangeLog	31 May 2003 04:41:05 -0000
@@ -1,3 +1,8 @@
+2003-05-31  Mike Kestner  <mkestner ximian com>
+
+	* gal/util/e-util.c (e_filename_make_safe): mangle the %'s out
+	too so that libxml2 doesn't convert the encoded hex values.
+
 2003-05-22  Jody Goldberg <jody gnome org>
 
 	* gal/widgets/widget-color-combo.c (color_combo_set_color) : Don't
Index: gal/util/e-util.c
===================================================================
RCS file: /cvs/gnome/gal/gal/util/e-util.c,v
retrieving revision 1.59
diff -u -p -r1.59 e-util.c
--- gal/util/e-util.c	28 May 2003 21:32:52 -0000	1.59
+++ gal/util/e-util.c	31 May 2003 04:41:05 -0000
@@ -423,7 +423,7 @@ e_filename_make_safe (gchar *string)
 	g_return_if_fail (string != NULL);
 	
 	for (p = string; *p; p++) {
-		if (!isprint ((unsigned char)*p) || strchr (" /'\"`&();|<>${}!", *p))
+		if (!isprint ((unsigned char)*p) || strchr (" /'\"`&();|<>$%{}!", *p))
 			*p = '_';
 	}
 }


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