]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Regard dir/ls on non-existent directory as an error.
authorOwen Dunn <owen@greenend.org.uk>
Sat, 18 Feb 2017 22:46:38 +0000 (22:46 +0000)
committerOwen Dunn <owen@greenend.org.uk>
Sat, 18 Feb 2017 22:51:03 +0000 (22:51 +0000)
sftp_cmd_ls - return an error if attempting to open the directory
fails.

psftp.c

diff --git a/psftp.c b/psftp.c
index 4fba2d73fd184659572c67f27b56404773c7a618..5394c1fbb9150007422c8f9d0b39da66ff8aa37e 100644 (file)
--- a/psftp.c
+++ b/psftp.c
@@ -1050,6 +1050,7 @@ int sftp_cmd_ls(struct sftp_command *cmd)
 
     if (dirh == NULL) {
        printf("Unable to open %s: %s\n", dir, fxp_error());
+       return 0;
     } else {
        nnames = namesize = 0;
        ournames = NULL;