Skip to content

Commit d13d38a

Browse files
committed
Trim multiple leading slashes in NestedLocation
See gh-37668
1 parent 88bf3df commit d13d38a

File tree

1 file changed

+4
-2
lines changed
  • spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/net/protocol/nested

1 file changed

+4
-2
lines changed

spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/net/protocol/nested/NestedLocation.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,10 @@ static NestedLocation parse(String path) {
102102

103103
private static NestedLocation create(int index, String location) {
104104
String locationPath = location.substring(0, index);
105-
if (isWindows() && locationPath.startsWith("/")) {
106-
locationPath = locationPath.substring(1, locationPath.length());
105+
if (isWindows()) {
106+
while (locationPath.startsWith("/")) {
107+
locationPath = locationPath.substring(1, locationPath.length());
108+
}
107109
}
108110
String nestedEntryName = location.substring(index + 2);
109111
return new NestedLocation((!locationPath.isEmpty()) ? Path.of(locationPath) : null, nestedEntryName);

0 commit comments

Comments
 (0)