diff options
author | Federico Mena Quintero <federico@ximian.com> | 2004-04-06 03:07:49 +0000 |
---|---|---|
committer | Federico Mena Quintero <federico@src.gnome.org> | 2004-04-06 03:07:49 +0000 |
commit | e88aef82d6432854c4d4e08e9a11a8d0433877ce (patch) | |
tree | c43ac857b3a516ab7fcd66c5b24b6547051884fd /gtk | |
parent | a0f3ee5660e8de5491aaea8afc57852985ddf4b7 (diff) | |
download | gtk+-e88aef82d6432854c4d4e08e9a11a8d0433877ce.tar.gz |
Look for G_DIR_SEPARATOR in the display_name, and err out if it is
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.
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkfilesystemunix.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gtk/gtkfilesystemunix.c b/gtk/gtkfilesystemunix.c index c71a643e00..9d4f63eb88 100644 --- a/gtk/gtkfilesystemunix.c +++ b/gtk/gtkfilesystemunix.c @@ -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) { |