summaryrefslogtreecommitdiff
path: root/src/nautilus-view.c
diff options
context:
space:
mode:
authorCarlos Soriano <csoriano@gnome.org>2015-04-21 15:15:38 +0200
committerCarlos Soriano <csoriano@gnome.org>2015-04-22 13:18:05 +0200
commit0004e583050ac199dd8c0eb54b28b1f32625286c (patch)
treea6c27d5dc3a5435dad2a1827d3a436f47825ad26 /src/nautilus-view.c
parent7000dcbedcc6502d039d4fc71d8bec45ca31ae86 (diff)
downloadnautilus-0004e583050ac199dd8c0eb54b28b1f32625286c.tar.gz
view: make "." and ".." as file names invalid
Diffstat (limited to 'src/nautilus-view.c')
-rw-r--r--src/nautilus-view.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/nautilus-view.c b/src/nautilus-view.c
index e06da3f20..5f18d360f 100644
--- a/src/nautilus-view.c
+++ b/src/nautilus-view.c
@@ -1697,6 +1697,16 @@ nautilus_view_validate_file_name (FileNameDialogData *data)
gtk_label_set_label (GTK_LABEL (data->error_label), _("Folder names cannot contain “/”."));
else
gtk_label_set_label (GTK_LABEL (data->error_label), _("Files names cannot contain “/”."));
+ } else if (strcmp (name, ".") == 0){
+ if (data->target_is_folder)
+ gtk_label_set_label (GTK_LABEL (data->error_label), _("A folder can not be called “.”."));
+ else
+ gtk_label_set_label (GTK_LABEL (data->error_label), _("A file can not be called “.”."));
+ } else if (strcmp (name, "..") == 0){
+ if (data->target_is_folder)
+ gtk_label_set_label (GTK_LABEL (data->error_label), _("A folder can not be called “..”."));
+ else
+ gtk_label_set_label (GTK_LABEL (data->error_label), _("A file can not be called “..”."));
} else {
/* No errors detected, empty the label */
gtk_label_set_label (GTK_LABEL (data->error_label), NULL);