- 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/ssh.c b/ssh.c
index ac1c1db..c6beb1b 100644
--- a/ssh.c
+++ b/ssh.c
@@ -40,7 +40,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: ssh.c,v 1.187 2002/11/21 23:04:33 markus Exp $");
+RCSID("$OpenBSD: ssh.c,v 1.188 2002/11/27 17:53:35 markus Exp $");
 
 #include <openssl/evp.h>
 #include <openssl/err.h>
@@ -495,9 +495,9 @@
 	av += optind;
 
 	if (ac > 0 && !host && **av != '-') {
-		if (strchr(*av, '@')) {
+		if (strrchr(*av, '@')) {
 			p = xstrdup(*av);
-			cp = strchr(p, '@');
+			cp = strrchr(p, '@');
 			if (cp == NULL || cp == p)
 				usage();
 			options.user = p;