}
/* 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
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