summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2004-01-27 10:08:11 +0000
committerDamien Miller <djm@cvs.openbsd.org>2004-01-27 10:08:11 +0000
commit14abf12ccd1f8ef2aabdd896b86ef04604755727 (patch)
tree3a48b2bdfa7a43ae3030385a9a9c2a66efa2f8b2
parent07aff8a86c6f76baa9d626b51db84765a0882548 (diff)
reorder parsing so user:skey@host:file works (bugzilla #777)
patch from admorten AT umich.edu; ok markus@
-rw-r--r--usr.bin/ssh/sftp.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/ssh/sftp.c b/usr.bin/ssh/sftp.c
index 0164547718a..df9360b9dfe 100644
--- a/usr.bin/ssh/sftp.c
+++ b/usr.bin/ssh/sftp.c
@@ -24,7 +24,7 @@
#include "includes.h"
-RCSID("$OpenBSD: sftp.c,v 1.40 2004/01/21 03:07:59 djm Exp $");
+RCSID("$OpenBSD: sftp.c,v 1.41 2004/01/27 10:08:10 djm Exp $");
#include "buffer.h"
#include "xmalloc.h"
@@ -205,11 +205,6 @@ main(int argc, char **argv)
userhost = xstrdup(argv[optind]);
file2 = argv[optind+1];
- if ((cp = colon(userhost)) != NULL) {
- *cp++ = '\0';
- file1 = cp;
- }
-
if ((host = strrchr(userhost, '@')) == NULL)
host = userhost;
else {
@@ -221,6 +216,11 @@ main(int argc, char **argv)
addargs(&args, "-l%s",userhost);
}
+ if ((cp = colon(host)) != NULL) {
+ *cp++ = '\0';
+ file1 = cp;
+ }
+
host = cleanhostname(host);
if (!*host) {
fprintf(stderr, "Missing hostname\n");