Skip to content

Commit

Permalink
lastIndex*O*f
Browse files Browse the repository at this point in the history
  • Loading branch information
bodewig committed Oct 14, 2024
1 parent 7c6c127 commit 2540910
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions WHATSNEW
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
Changes from Ant 1.10.15 TO Ant 1.10.16
=======================================

Fixed bugs:
-----------

* <scp> now properly handles IPv6 addresses as hostnames.
Bugzilla Report 59160

Changes from Ant 1.10.14 TO Ant 1.10.15
=======================================
Expand Down
5 changes: 3 additions & 2 deletions src/main/org/apache/tools/ant/taskdefs/optional/ssh/Scp.java
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,9 @@ private String parseUri(final String uri) {
throw new BuildException("no username was given. Can't authenticate.");
}

// For IPv6 address having more than one ":", it should look for the last occurrence
final int indexOfPath = uri.lastIndexof(':');
// For IPv6 addresses, the host part may contain more than one ":",
// look for the last occurrence
final int indexOfPath = uri.lastIndexOf(':');
if (indexOfPath <= indexOfAt) {
throw new BuildException("no remote path in %s", uri);
}
Expand Down

0 comments on commit 2540910

Please sign in to comment.