diff options
Diffstat (limited to 'sftp.c')
-rw-r--r-- | sftp.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -24,7 +24,7 @@ | |||
24 | 24 | ||
25 | #include "includes.h" | 25 | #include "includes.h" |
26 | 26 | ||
27 | RCSID("$OpenBSD: sftp.c,v 1.40 2004/01/21 03:07:59 djm Exp $"); | 27 | RCSID("$OpenBSD: sftp.c,v 1.41 2004/01/27 10:08:10 djm Exp $"); |
28 | 28 | ||
29 | #include "buffer.h" | 29 | #include "buffer.h" |
30 | #include "xmalloc.h" | 30 | #include "xmalloc.h" |
@@ -212,11 +212,6 @@ main(int argc, char **argv) | |||
212 | userhost = xstrdup(argv[optind]); | 212 | userhost = xstrdup(argv[optind]); |
213 | file2 = argv[optind+1]; | 213 | file2 = argv[optind+1]; |
214 | 214 | ||
215 | if ((cp = colon(userhost)) != NULL) { | ||
216 | *cp++ = '\0'; | ||
217 | file1 = cp; | ||
218 | } | ||
219 | |||
220 | if ((host = strrchr(userhost, '@')) == NULL) | 215 | if ((host = strrchr(userhost, '@')) == NULL) |
221 | host = userhost; | 216 | host = userhost; |
222 | else { | 217 | else { |
@@ -228,6 +223,11 @@ main(int argc, char **argv) | |||
228 | addargs(&args, "-l%s",userhost); | 223 | addargs(&args, "-l%s",userhost); |
229 | } | 224 | } |
230 | 225 | ||
226 | if ((cp = colon(host)) != NULL) { | ||
227 | *cp++ = '\0'; | ||
228 | file1 = cp; | ||
229 | } | ||
230 | |||
231 | host = cleanhostname(host); | 231 | host = cleanhostname(host); |
232 | if (!*host) { | 232 | if (!*host) { |
233 | fprintf(stderr, "Missing hostname\n"); | 233 | fprintf(stderr, "Missing hostname\n"); |