]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - pscp.c
Return an error if there's an error doing pscp -ls
[PuTTY.git] / pscp.c
diff --git a/pscp.c b/pscp.c
index dd3beb0c03f97e74ddbb6edb2a583baff139f770..150b5492b8948b3a90b0a17895970f58ab081df2 100644 (file)
--- a/pscp.c
+++ b/pscp.c
@@ -383,6 +383,7 @@ static void do_cmd(char *host, char *user, char *cmd)
            /* Use `host' as a bare hostname. */
            conf_set_str(conf, CONF_host, host);
        }
+        conf_free(conf2);
     } else {
        /* Patch in hostname `host' to session details. */
        conf_set_str(conf, CONF_host, host);
@@ -698,7 +699,8 @@ void scp_sftp_listdir(const char *dirname)
     dirh = fxp_opendir_recv(pktin, req);
 
     if (dirh == NULL) {
-       printf("Unable to open %s: %s\n", dirname, fxp_error());
+               tell_user(stderr, "Unable to open %s: %s\n", dirname, fxp_error());
+               errs++;
     } else {
        nnames = namesize = 0;
        ournames = NULL;
@@ -2271,7 +2273,7 @@ void version(void)
     char *buildinfo_text = buildinfo("\n");
     printf("pscp: %s\n%s\n", ver, buildinfo_text);
     sfree(buildinfo_text);
-    cleanup_exit(1);
+    exit(0);
 }
 
 void cmdline_error(const char *p, ...)