From 66307dc43142bd5233b2af5dfe0eaf190657bc24 Mon Sep 17 00:00:00 2001 From: sgunderson Date: Sat, 30 Sep 2000 20:42:24 +0000 Subject: [PATCH] Fixed the ls -R' seems to ignore its argument. --- cmds.c | 11 ++++++++++- doc/KNOWN-BUGS | 5 ++--- 2 files changed, 12 insertions(+), 4 deletions(-) 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 -- 2.39.2