From fe2d7e6728ee0645c750e137c004d16af2205115 Mon Sep 17 00:00:00 2001 From: Matthew Jason Benson Date: Tue, 27 Jun 2006 21:39:46 +0000 Subject: [PATCH] allow @s before the "real" one in scp uris. Bugzilla 38082. Submitted by Michael Montuori/Robert Anderson. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@417590 13f79535-47bb-0310-9956-ffa450edef68 --- CONTRIBUTORS | 1 + WHATSNEW | 3 +++ src/main/org/apache/tools/ant/taskdefs/optional/ssh/Scp.java | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index a74376d9f..f4386fd75 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -160,6 +160,7 @@ Matthew Watson Michael Davey Michael J. Sikorsky Michael McCallum +Michael Montuori Michael Newcomb Michael Saunders Miha diff --git a/WHATSNEW b/WHATSNEW index 6f0be0e06..f0940891b 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -232,6 +232,9 @@ Fixed bugs: erroneously deleted the "destination" file before attempting to rename the source file. Bugzilla 37701. +* can now handle uris with @s other than the final one denoting the + domain. Bugzilla 38082. + Other changes: -------------- * took in bugzilla report 39320. diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ssh/Scp.java b/src/main/org/apache/tools/ant/taskdefs/optional/ssh/Scp.java index e74cb6fcb..7ae18c3cc 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/ssh/Scp.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/ssh/Scp.java @@ -307,7 +307,7 @@ public class Scp extends SSHBase { } private String parseUri(String uri) { - int indexOfAt = uri.indexOf('@'); + int indexOfAt = uri.lastIndexOf('@'); int indexOfColon = uri.indexOf(':'); if (indexOfColon > -1 && indexOfColon < indexOfAt) { // user:password@host:/path notation