summaryrefslogtreecommitdiff
path: root/sftp.c
diff options
context:
space:
mode:
Diffstat (limited to 'sftp.c')
-rw-r--r--sftp.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/sftp.c b/sftp.c
index 04881c83f..03c7a5c72 100644
--- a/sftp.c
+++ b/sftp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sftp.c,v 1.191 2019/06/06 05:13:13 otto Exp $ */ 1/* $OpenBSD: sftp.c,v 1.192 2019/06/07 03:47:12 dtucker Exp $ */
2/* 2/*
3 * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org> 3 * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
4 * 4 *
@@ -2527,12 +2527,17 @@ main(int argc, char **argv)
2527 port = tmp; 2527 port = tmp;
2528 break; 2528 break;
2529 default: 2529 default:
2530 /* Try with user, host and path. */
2530 if (parse_user_host_path(*argv, &user, &host, 2531 if (parse_user_host_path(*argv, &user, &host,
2531 &file1) == -1) { 2532 &file1) == 0)
2532 /* Treat as a plain hostname. */ 2533 break;
2533 host = xstrdup(*argv); 2534 /* Try with user and host. */
2534 host = cleanhostname(host); 2535 if (parse_user_host_port(*argv, &user, &host, NULL)
2535 } 2536 == 0)
2537 break;
2538 /* Treat as a plain hostname. */
2539 host = xstrdup(*argv);
2540 host = cleanhostname(host);
2536 break; 2541 break;
2537 } 2542 }
2538 file2 = *(argv + 1); 2543 file2 = *(argv + 1);