diff src/ui_pathsel.c @ 373:61a3c8b05b24

Add a new option in Preferences > Filtering to allow the user to choose to display '.' directory in folder lists or not. This option is saved to rc file as file_filter.show_dot_directory. A minor fix was made to disable display of .. in folder selection dialogs when current path is /.
author zas_
date Tue, 15 Apr 2008 20:36:11 +0000
parents 9995c5fb202a
children 4b2d7f9af171
line wrap: on
line diff
--- a/src/ui_pathsel.c	Tue Apr 15 20:00:27 2008 +0000
+++ b/src/ui_pathsel.c	Tue Apr 15 20:36:11 2008 +0000
@@ -178,6 +178,12 @@
 		}
 	while ((dir = readdir(dp)) != NULL)
 		{
+		if (!options->file_filter.show_dot_directory
+		    && dir->d_name[0] == '.' && dir->d_name[1] == '\0')
+		    	continue;
+		if (dir->d_name[0] == '.' && dir->d_name[1] == '.' && dir->d_name[2] == '\0'
+		    && pathl[0] == '/' && pathl[1] == '\0')
+		    	continue; /* no .. for root directory */
 		if (dd->show_hidden || !is_hidden(dir->d_name))
 			{
 			gchar *name = dir->d_name;