diff --git a/src/uifc/filepick.c b/src/uifc/filepick.c
index 419d15a2df94cc817f3f89bb9b6489359a2f2d2e..f50b55e14fc055f96f1d0c4ce6246c212e5ee172 100644
--- a/src/uifc/filepick.c
+++ b/src/uifc/filepick.c
@@ -298,8 +298,8 @@ int filepick(uifcapi_t *api, char *title, struct file_pick *fp, char *dir, char
 	int		filecur=0;
 	int		filebar=0;
 	int		listwidth;
-	char	**dir_list;
-	char	**file_list;
+	char	**dir_list=NULL;
+	char	**file_list=NULL;
 	int		currfield=DIR_LIST;
 	int		lastfield=DIR_LIST;
 	int		i;
@@ -386,7 +386,7 @@ int filepick(uifcapi_t *api, char *title, struct file_pick *fp, char *dir, char
 #else
 //#error Need to do something about root paths (in get_file_opt_list() too!)
 #endif
-		if(glob(dglob, GLOB_MARK, NULL, &dgl)!=0) {
+		if(glob(dglob, GLOB_MARK, NULL, &dgl)!=0 && !isdir(cpath)) {
 			if(lastpath==NULL) {
 				fp->files=0;
 				retval=-1;