[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[gftp] Re: wrong directory entrys



On Sun, Sep 21, 2003 at 10:59:32AM +0200, Oliver Lehmann wrote:
> Oliver Lehmann wrote:
> 
> > Hi,
> > 
> > changing the loca directory to "/" only displays:
> > 
> > dev
> > usr
> > var
> 
> Are you working on thet Brian? See the attached images for the
> situation...

Here is a patch from CVS to fix the truncated directory listings. I found the 
problem would occur if you had a dangling symlink in your current directory.

Brian



Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gftp/ChangeLog,v
retrieving revision 1.138
diff -u -r1.138 ChangeLog
--- ChangeLog	21 Sep 2003 16:21:35 -0000	1.138
+++ ChangeLog	21 Sep 2003 16:46:57 -0000
@@ -1,10 +1,17 @@
 2003-9-21 Brian Masney <masneyb@gftp.org>
+	* lib/local.c src/gtk/transfer.c src/text/gftp-text.c - if there is a
+	dangling symlink in the current directory, don't bail out. This was 
+	causing directory listings to appear truncated.
+
 	* lib/rfc959.c - if there is a login failure, return GFTP_ERETRYABLE
 	(from winkey <rush@winkey.oompah.org>)
 
 2003-09-01  Metin Amiroff  <metin@karegen.com>
 
 	configure.in: Added "az" in ALL_LINGUAS.
+
+2003-8-21 Brian Masney <masneyb@gftp.org>
+	* Officially released 2.0.15
 
 2003-8-20 Brian Masney <masneyb@gftp.org>
 	* lib/gftp.h lib/protocols.c - largefile fixes
cvs server: Diffing lib
Index: lib/local.c
===================================================================
RCS file: /cvs/gnome/gftp/lib/local.c,v
retrieving revision 1.26
diff -u -r1.26 local.c
--- lib/local.c	12 Aug 2003 01:05:02 -0000	1.26
+++ lib/local.c	21 Sep 2003 16:46:57 -0000
@@ -315,23 +315,15 @@
     {
       closedir (lpd->dir);
       lpd->dir = NULL;
-      return (GFTP_ERETRYABLE);
+      return (GFTP_EFATAL);
     }
 
   fle->file = g_strdup (dirp->d_name);
   if (lstat (fle->file, &st) != 0)
-    {
-      closedir (lpd->dir);
-      lpd->dir = NULL;
-      return (GFTP_ERETRYABLE);
-    }
+    return (GFTP_ERETRYABLE);
 
   if (stat (fle->file, &fst) != 0)
-    {
-      closedir (lpd->dir);
-      lpd->dir = NULL;
-      return (GFTP_ERETRYABLE);
-    }
+    return (GFTP_ERETRYABLE);
 
   if ((user = g_hash_table_lookup (lpd->userhash, 
                                    GUINT_TO_POINTER(st.st_uid))) != NULL)
cvs server: Diffing src
cvs server: Diffing src/gtk
Index: src/gtk/transfer.c
===================================================================
RCS file: /cvs/gnome/gftp/src/gtk/transfer.c,v
retrieving revision 1.39
diff -u -r1.39 transfer.c
--- src/gtk/transfer.c	12 Aug 2003 01:05:02 -0000	1.39
+++ src/gtk/transfer.c	21 Sep 2003 16:46:58 -0000
@@ -104,8 +104,15 @@
       request->gotbytes = 0; 
       havedotdot = 0; 
       fle = g_malloc0 (sizeof (*fle));
-      while ((got = gftp_get_next_file (request, NULL, fle)) > 0)
+      while ((got = gftp_get_next_file (request, NULL, fle)) > 0 ||
+             got == GFTP_ERETRYABLE)
         { 
+          if (got < 0)
+            {
+              gftp_file_destroy (fle);
+              continue;
+            }
+
           request->gotbytes += got;
           if (strcmp (fle->file, ".") == 0)
             {
cvs server: Diffing src/text
Index: src/text/gftp-text.c
===================================================================
RCS file: /cvs/gnome/gftp/src/text/gftp-text.c,v
retrieving revision 1.26
diff -u -r1.26 gftp-text.c
--- src/text/gftp-text.c	24 Jul 2003 01:48:33 -0000	1.26
+++ src/text/gftp-text.c	21 Sep 2003 16:46:58 -0000
@@ -595,7 +595,7 @@
 {
   GList * files, * templist, * delitem;
   char *color, *filespec, *tempstr;
-  int sortcol, sortasds;
+  int sortcol, sortasds, got;
   gftp_file * fle;
   time_t curtime;
 
@@ -613,9 +613,10 @@
 
   files = NULL;
   fle = g_malloc0 (sizeof (*fle));
-  while (gftp_get_next_file (request, NULL, fle) > 0)
+  while ((got = gftp_get_next_file (request, NULL, fle)) > 0 ||
+         got == GFTP_ERETRYABLE)
     {
-      if (strcmp (fle->file, ".") == 0)
+      if (got < 0 || strcmp (fle->file, ".") == 0)
         {
           gftp_file_destroy (fle);
           continue;