This is an automated email from the ASF dual-hosted git repository.

bodewig pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ant.git

commit e0a636389911cf221832646569702b70c7096169
Author: FROZENCADET <51886109+frozenca...@users.noreply.github.com>
AuthorDate: Thu Oct 3 13:59:11 2024 +0530

    BUG-ID : 59160 , fix extracting host for ipv6 address
---
 src/main/org/apache/tools/ant/taskdefs/optional/ssh/Scp.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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 3d181d30e..b86f4dc32 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
@@ -435,7 +435,8 @@ public class Scp extends SSHBase {
             throw new BuildException("no username was given.  Can't 
authenticate.");
         }
 
-        final int indexOfPath = uri.indexOf(':', indexOfAt + 1);
+        // For IPv6 address having more than one ":", it should look for the 
last occurrence
+        final int indexOfPath = uri.lastIndexof(':');
         if (indexOfPath == -1) {
             throw new BuildException("no remote path in %s", uri);
         }

Reply via email to