- (djm) OpenBSD CVS Sync
   - mouring@cvs.openbsd.org 2001/04/16 02:31:44
     [scp.c sftp.c]
     IPv6 support for sftp (which I bungled in my last patch) which is
     borrowed from scp.c.  Thanks to Markus@ for pointing it out.
diff --git a/sftp.c b/sftp.c
index 911a04f..8c887fb 100644
--- a/sftp.c
+++ b/sftp.c
@@ -24,10 +24,9 @@
 
 #include "includes.h"
 
-RCSID("$OpenBSD: sftp.c,v 1.14 2001/04/12 23:17:54 mouring Exp $");
+RCSID("$OpenBSD: sftp.c,v 1.15 2001/04/16 02:31:44 mouring Exp $");
 
 /* XXX: commandline mode */
-/* XXX: copy between two remote hosts (commandline) */
 /* XXX: short-form remote directory listings (like 'ls -C') */
 
 #include "buffer.h"
@@ -46,6 +45,8 @@
 char *__progname;
 #endif
 
+#include "scp-common.h"
+
 int use_ssh1 = 0;
 char *ssh_program = _PATH_SSH_PROGRAM;
 char *sftp_server = NULL;
@@ -209,7 +210,7 @@
 	userhost = xstrdup(argv[optind]);
 	file2 = argv[optind+1];
 
-	if ((cp = strchr(userhost, ':')) != NULL) {
+	if ((cp = colon(userhost)) != NULL) {
 		*cp++ = '\0';
 		file1 = cp;
 	}
@@ -226,6 +227,7 @@
 		make_ssh_args(userhost);
 	}
 
+	host = cleanhostname(host);
 	if (!*host) {
 		fprintf(stderr, "Missing hostname\n");
 		usage();