From: sgunderson Date: Sat, 30 Sep 2000 20:42:24 +0000 (+0000) Subject: Fixed the ls -R' seems to ignore its argument. X-Git-Url: https://git.sesse.net/?p=betaftpd;a=commitdiff_plain;h=66307dc43142bd5233b2af5dfe0eaf190657bc24 Fixed the ls -R' seems to ignore its argument. --- diff --git a/cmds.c b/cmds.c index 629d114..9e1edca 100644 --- 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 diff --git a/doc/KNOWN-BUGS b/doc/KNOWN-BUGS index 4f68e99..0f73677 100644 --- a/doc/KNOWN-BUGS +++ b/doc/KNOWN-BUGS @@ -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