Re: [evolution-patches] 71105, abort() reached if you rename with / in it




i've committed this with a slight string change as below.  this is so it wont break string freeze.

i didn't use this string in the head version since it doesn't have camel in it anymore, where the string comes from.

On Tue, 2005-01-18 at 13:32 +0800, Not Zed wrote:

so, this dissallows using / in names from the rename requester.

/ is used specifically as a path separator for camel's folder abstraction, and there is no escape mechanism to support it indirectly either.

(patch against head, but intended for 2.0, and should apply)

--
Michael Zucchi <notzed ximian com>
"Ride, Work, Sleep. Beer."
Novell's Evolution and Free Software Developer
Index: mail/em-folder-tree.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-folder-tree.c,v
retrieving revision 1.125.4.5
diff -u -p -r1.125.4.5 em-folder-tree.c
--- mail/em-folder-tree.c	6 Oct 2004 09:25:13 -0000	1.125.4.5
+++ mail/em-folder-tree.c	19 Jan 2005 03:53:55 -0000
@@ -2631,7 +2631,15 @@ emft_popup_rename_folder (GtkWidget *ite
 	prompt = g_strdup_printf (_("Rename the \"%s\" folder to:"), name);
 	while (!done) {
 		new_name = e_request_string (NULL, _("Rename Folder"), prompt, name);
-		if (new_name == NULL || !strcmp (name, new_name)) {
+		if (strchr(new_name, '/') != NULL) {
+			char *tmp;
+
+			tmp = g_strdup_printf(_("The folder name \"%s\" is invalid because it contains the character \"%c\""), new_name, '/');
+			e_error_run((GtkWindow *)gtk_widget_get_toplevel((GtkWidget *)emft),
+				    "mail:no-rename-folder", name, new_name, tmp, NULL);
+			g_free(tmp);
+			done = TRUE;
+		} else if (new_name == NULL || !strcmp (name, new_name)) {
 			/* old name == new name */
 			done = TRUE;
 		} else {


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