]> git.sesse.net Git - betaftpd/commitdiff
Fixed the ls -R' seems to ignore its argument.
authorsgunderson <sgunderson>
Sat, 30 Sep 2000 20:42:24 +0000 (20:42 +0000)
committersgunderson <sgunderson>
Sat, 30 Sep 2000 20:42:24 +0000 (20:42 +0000)
cmds.c
doc/KNOWN-BUGS

diff --git a/cmds.c b/cmds.c
index 629d11411156082cea5cad865e077f1ab67ed906..9e1edcaa80827177bb1aade3446fe9c013390dd7 100644 (file)
--- a/cmds.c
+++ b/cmds.c
@@ -1856,7 +1856,16 @@ int prepare_for_listing(struct conn * const c, char ** const ptr,
        }
 
        /* if no argument, choose all files */
-       if (fptr == NULL || fptr[0] == 0) fptr = "*";
+       if (fptr == NULL || fptr[0] == 0) {
+               fptr = "*";
+       } else {
+               /* we need to check if the last part is a directory (no -d switch) */
+               struct stat buf;
+               if (stat(fptr, &buf) == 0 && S_ISDIR(buf.st_mode)) {
+                       TRAP_ERROR(chdir(fptr) == -1, 550, return -1);
+                       fptr = "*";
+               }
+       }
        *ptr = fptr;
 
 #if WANT_NONROOT
index 4f68e99e5113a98949953b2ee31894d7ecb304f6..0f73677c04ca2b76fe6042d7469d9c15d0458b02 100644 (file)
@@ -1,7 +1,6 @@
 List of known bugs and problems:
-- The directory cache is currently a bit buggy -- it is unable to distinguish
-  between listing a directory and its contents. Adding a -d flag to the internal
-  ls might help this -- perhaps the bug isn't only in the dcache.
+- The -R argument to list seems to ignore the argument given to it (this is not
+  very high on the list ATM).
 - Some commands are still not implemented (see the file RFC-COMPLIANCE). There
   are very few I actually miss now... None, actually.
 - There are several hardcoded limits, instead of using constants such as