]> Pileus Git - ~andy/gtk/commitdiff
Look for G_DIR_SEPARATOR in the display_name, and err out if it is
authorFederico Mena Quintero <federico@ximian.com>
Tue, 6 Apr 2004 03:07:49 +0000 (03:07 +0000)
committerFederico Mena Quintero <federico@src.gnome.org>
Tue, 6 Apr 2004 03:07:49 +0000 (03:07 +0000)
2004-04-05  Federico Mena Quintero  <federico@ximian.com>

* gtk/gtkfilesystemunix.c (gtk_file_system_unix_make_path): Look
for G_DIR_SEPARATOR in the display_name, and err out if it is
present; use the same error message as Nautilus.  Fixes #136467.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkfilesystemunix.c

index c26512648879441cab3097d12fbabe5f3fbfc8f1..42a1c15d0c99afd8e076b68f6d68db7ce09db293 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2004-04-05  Federico Mena Quintero  <federico@ximian.com>
 
+       * gtk/gtkfilesystemunix.c (gtk_file_system_unix_make_path): Look
+       for G_DIR_SEPARATOR in the display_name, and err out if it is
+       present; use the same error message as Nautilus.  Fixes #136467.
+
        * gtk/gtkfilechooserdefault.c (file_pane_create): Make the
        new-folder button say "Create Fo_lder" rather than "Create
        _Folder", so that the mnemonic doesn't conflict with the "Save in
index c26512648879441cab3097d12fbabe5f3fbfc8f1..42a1c15d0c99afd8e076b68f6d68db7ce09db293 100644 (file)
@@ -1,5 +1,9 @@
 2004-04-05  Federico Mena Quintero  <federico@ximian.com>
 
+       * gtk/gtkfilesystemunix.c (gtk_file_system_unix_make_path): Look
+       for G_DIR_SEPARATOR in the display_name, and err out if it is
+       present; use the same error message as Nautilus.  Fixes #136467.
+
        * gtk/gtkfilechooserdefault.c (file_pane_create): Make the
        new-folder button say "Create Fo_lder" rather than "Create
        _Folder", so that the mnemonic doesn't conflict with the "Save in
index c26512648879441cab3097d12fbabe5f3fbfc8f1..42a1c15d0c99afd8e076b68f6d68db7ce09db293 100644 (file)
@@ -1,5 +1,9 @@
 2004-04-05  Federico Mena Quintero  <federico@ximian.com>
 
+       * gtk/gtkfilesystemunix.c (gtk_file_system_unix_make_path): Look
+       for G_DIR_SEPARATOR in the display_name, and err out if it is
+       present; use the same error message as Nautilus.  Fixes #136467.
+
        * gtk/gtkfilechooserdefault.c (file_pane_create): Make the
        new-folder button say "Create Fo_lder" rather than "Create
        _Folder", so that the mnemonic doesn't conflict with the "Save in
index c26512648879441cab3097d12fbabe5f3fbfc8f1..42a1c15d0c99afd8e076b68f6d68db7ce09db293 100644 (file)
@@ -1,5 +1,9 @@
 2004-04-05  Federico Mena Quintero  <federico@ximian.com>
 
+       * gtk/gtkfilesystemunix.c (gtk_file_system_unix_make_path): Look
+       for G_DIR_SEPARATOR in the display_name, and err out if it is
+       present; use the same error message as Nautilus.  Fixes #136467.
+
        * gtk/gtkfilechooserdefault.c (file_pane_create): Make the
        new-folder button say "Create Fo_lder" rather than "Create
        _Folder", so that the mnemonic doesn't conflict with the "Save in
index c26512648879441cab3097d12fbabe5f3fbfc8f1..42a1c15d0c99afd8e076b68f6d68db7ce09db293 100644 (file)
@@ -1,5 +1,9 @@
 2004-04-05  Federico Mena Quintero  <federico@ximian.com>
 
+       * gtk/gtkfilesystemunix.c (gtk_file_system_unix_make_path): Look
+       for G_DIR_SEPARATOR in the display_name, and err out if it is
+       present; use the same error message as Nautilus.  Fixes #136467.
+
        * gtk/gtkfilechooserdefault.c (file_pane_create): Make the
        new-folder button say "Create Fo_lder" rather than "Create
        _Folder", so that the mnemonic doesn't conflict with the "Save in
index c71a643e000a1d76543860157285db1c5699f6a6..9d4f63eb882ccf785635a8bd6de82afc7d8ee688 100644 (file)
@@ -769,6 +769,18 @@ gtk_file_system_unix_make_path (GtkFileSystem    *file_system,
   g_return_val_if_fail (base_filename != NULL, NULL);
   g_return_val_if_fail (g_path_is_absolute (base_filename), NULL);
 
+  if (strchr (display_name, G_DIR_SEPARATOR))
+    {
+      g_set_error (error,
+                  GTK_FILE_SYSTEM_ERROR,
+                  GTK_FILE_SYSTEM_ERROR_BAD_FILENAME,
+                  _("The name \"%s\" is not valid because it contains the character \"%s\". "
+                    "Please use a different name."),
+                  display_name,
+                  G_DIR_SEPARATOR_S);
+      return NULL;
+    }
+
   filename = g_filename_from_utf8 (display_name, -1, NULL, NULL, &tmp_error);
   if (!filename)
     {