[evolution-patches] patch for 47535



Hi All,
	See attached patch for http://bugzilla.ximian.com/show_bug.cgi?id=47535
Pl. check this and lemme know.
Thanks & Regards,
Suresh
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gal/ChangeLog,v
retrieving revision 1.790
diff -u -r1.790 ChangeLog
--- ChangeLog	25 Jun 2003 17:24:34 -0000	1.790
+++ ChangeLog	7 Aug 2003 22:03:41 -0000
@@ -1,3 +1,8 @@
+2003-08-07  Suresh Chandrasekharan  <suresh chandrasekharan sun com>
+
+	* gal/util/e-util.c (e_filename_make_safe): Fix for 47535
+	e_filename_make_safe routine not utf8 friendly.
+
 2003-06-25  Mike Kestner  <mkestner ximian com>
 
 	* configure.in : releasing 1.99.8
Index: gal/util/e-util.c
===================================================================
RCS file: /cvs/gnome/gal/gal/util/e-util.c,v
retrieving revision 1.60
diff -u -r1.60 e-util.c
--- gal/util/e-util.c	31 May 2003 17:21:23 -0000	1.60
+++ gal/util/e-util.c	7 Aug 2003 22:03:41 -0000
@@ -418,13 +418,25 @@
 void
 e_filename_make_safe (gchar *string)
 {
-	gchar *p;
+	gchar *p, *ts;
+	gunichar c;
+	gboolean flag = FALSE;
 	
 	g_return_if_fail (string != NULL);
-	
-	for (p = string; *p; p++) {
-		if (!isprint ((unsigned char)*p) || strchr (" /'\"`&();|<>$%{}!", *p))
-			*p = '_';
+	p = string;
+
+	while(p && *p) {
+		c = g_utf8_get_char (p);
+		if (!g_unichar_isprint (c)) {
+			flag = TRUE;		
+		}
+		ts = p;
+		p = g_utf8_next_char (p);
+		if (flag || strchr (" /'\"`&();|<>$%{}!", *ts)) {
+			flag = FALSE;
+			while (ts<p) 	
+				*ts++ = '_';
+		}
 	}
 }
 


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