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 b86f4dc32a..8719d39042 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 @@ private String parseUri(final String uri) { // 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); }