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 7c6c127e854e9dbb4d444181ac1fb43510485848
Author: FROZENCADET <51886109+frozenca...@users.noreply.github.com>
AuthorDate: Thu Oct 10 12:28:40 2024 +0530

    Ensure indexOfPath is bigger than indexOfAt
---
 src/main/org/apache/tools/ant/taskdefs/optional/ssh/Scp.java | 2 +-
 1 file changed, 1 insertion(+), 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 b86f4dc32..8719d3904 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
@@ -437,7 +437,7 @@ public class Scp extends SSHBase {
 
         // For IPv6 address having more than one ":", it should look for the 
last occurrence
         final int indexOfPath = uri.lastIndexof(':');
-        if (indexOfPath == -1) {
+        if (indexOfPath <= indexOfAt) {
             throw new BuildException("no remote path in %s", uri);
         }
 

Reply via email to