Borland makefile should now work sanely with the free-beer bcc55
[u/mdw/putty] / scp.c
diff --git a/scp.c b/scp.c
index ac232fa..f359c6e 100644 (file)
--- a/scp.c
+++ b/scp.c
@@ -120,14 +120,10 @@ static void do_cmd(char *host, char *user, char *cmd)
        cfg.port = 22;
     }
 
-    if (portnumber)
-       cfg.port = portnumber;
-
     /* Set username */
     if (user != NULL && user[0] != '\0') {
        strncpy(cfg.username, user, sizeof(cfg.username)-1);
        cfg.username[sizeof(cfg.username)-1] = '\0';
-       cfg.port = 22;
     } else if (cfg.username[0] == '\0') {
        bump("Empty user name");
     }
@@ -135,6 +131,9 @@ static void do_cmd(char *host, char *user, char *cmd)
     if (cfg.protocol != PROT_SSH)
        cfg.port = 22;
 
+    if (portnumber)
+       cfg.port = portnumber;
+
     err = ssh_init(cfg.host, cfg.port, cmd, &realhost);
     if (err != NULL)
        bump("ssh_init: %s", err);
@@ -311,7 +310,7 @@ static void source(char *src)
     f = CreateFile(src, GENERIC_READ, FILE_SHARE_READ, NULL,
                   OPEN_EXISTING, 0, 0);
     if (f == INVALID_HANDLE_VALUE) {
-       run_err("%s: Cannot open file");
+       run_err("%s: Cannot open file", src);
        return;
     }