- markus@cvs.openbsd.org 2002/11/27 17:53:35
     [scp.c sftp.c ssh.c]
     allow usernames with embedded '@', e.g. scp user@vhost@realhost:file /tmp;
     http://bugzilla.mindrot.org/show_bug.cgi?id=447; ok mouring@, millert@
diff --git a/sftp.c b/sftp.c
index c4055b9..c173e58 100644
--- a/sftp.c
+++ b/sftp.c
@@ -24,7 +24,7 @@
 
 #include "includes.h"
 
-RCSID("$OpenBSD: sftp.c,v 1.31 2002/07/25 01:16:59 mouring Exp $");
+RCSID("$OpenBSD: sftp.c,v 1.32 2002/11/27 17:53:35 markus Exp $");
 
 /* XXX: short-form remote directory listings (like 'ls -C') */
 
@@ -197,7 +197,7 @@
 			file1 = cp;
 		}
 
-		if ((host = strchr(userhost, '@')) == NULL)
+		if ((host = strrchr(userhost, '@')) == NULL)
 			host = userhost;
 		else {
 			*host++ = '\0';