diff lib/misc.c @ 422:38bfc112ab46

2004-3-14 Brian Masney <masneyb@gftp.org> * lib/misc.c (expand_path) - skip over paths that are empty * lib/misc.c (gftp_sort_filelist) - fixed NULL pointer dereference that would occur when attempting to sort an empty filelist (from Hans-J?rgen Sch?ler <hjschaeler@t-online.de>) * src/uicommon/gftpui.c (_gftpui_common_thread_callback) - fix so that retries would occur properly after a timeout (from Nam SungHyun <namsh@kldp.org>) * src/gtk/Makefile.am - removed unneeded localedir defination (from Nam SungHyun <namsh@kldp.org>) * lib/gftp.h lib/protocols.c src/gtk/gftp-gtk.c src/text/gftp-text.c - added gftp_setup_startup_directory(). This function will expand the startup directory so that ~ directories will work properly * lib/rfc959.c - removed invalid response error message if the user enters an invalid password * src/gtk/bookmarks.c - only allow one bookmark entry to be edited at a time. This is a design flaw in my code and I'll remove this restriction until I have time to recode this. Also, fixed segfault that would occur when renaming a bookmark * src/gtk/view_dialog.c - when editing a file, make sure the file has the right suffix so that syntax highlighting works
author masneyb
date Mon, 15 Mar 2004 18:07:15 +0000
parents 712d3810f4e1
children 1d45758e5cf5
line wrap: on
line diff
--- a/lib/misc.c	Wed Mar 10 17:54:33 2004 +0000
+++ b/lib/misc.c	Mon Mar 15 18:07:15 2004 +0000
@@ -794,6 +794,9 @@
   gftp_file * tempfle;
   intptr_t sort_dirs_first;
 
+  if (filelist == NULL) /* nothing to sort */
+    return (filelist);
+
   files = dirs = dotdot = NULL;
 
   if (column == GFTP_SORT_COL_FILE)
@@ -1195,6 +1198,9 @@
     {
       len = strlen (element);
 
+      if (len == 0)
+        continue;
+
       if (retlen > 0 && (ret[retlen - 1] == '/' || element[0] == '/'))
         add_separator = 0;
       else