gui_list fixed, quit during routign fixed.

master
steffen 12 years ago
parent e018fef72b
commit 867acfafcd

@ -1,4 +1,4 @@
/* $Id: gui_selectfile.c,v 1.3 2014/02/12 21:23:06 steffen Exp $ */
/* $Id: gui_selectfile.c,v 1.4 2014/02/12 23:05:35 steffen Exp $ */
/***************************************************************************
* gui_selectdir.c
*
@ -143,8 +143,6 @@ void gui_sfile_update () {
continue;
}
d_printf ("dir:%s", fname);
if (S_ISDIR(stbuf.st_mode)) {
/* need more memory? */
if (cnt >= wsf_listmax) {
/* save old pointer and counter */
char **tmp = wsf_list;
@ -160,16 +158,18 @@ void gui_sfile_update () {
for (; i >= 0; i--) wsf_list[i] = tmp[i];
ml_free (tmp);
}
/* setup new list */
GUI_LIST_T (wsf_flist)->data = wsf_list;
}
wsf_list[cnt] = ml_malloc (LEN_FILENAME);
strncpy (wsf_list[cnt], direntry->d_name, LEN_FILENAME);
if (S_ISDIR(stbuf.st_mode)) snprintf (wsf_list[cnt], LEN_FILENAME, "[%s]", direntry->d_name);
else snprintf (wsf_list[cnt], LEN_FILENAME, "%s", direntry->d_name);
d_printf ("added entry:%-3d '%s'", cnt, direntry->d_name);
cnt++;
}
}
closedir (dir);

Loading…
Cancel
Save