Skip to content
Snippets Groups Projects
Commit f32a3ce5 authored by deuce's avatar deuce
Browse files

Fix SEGFAULT on upload from empty directory two ways:

1) Properly initialize variables.
2) Just because a directory is empty doesn't mean it doesn't exist.
parent fb6bf9f7
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment