Skip to content

Commit 978e81e

Browse files
committed
Merge branch '6.0.x'
2 parents 2b7a920 + e71117d commit 978e81e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

spring-core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,8 +490,9 @@ protected void addClassPathManifestEntries(Set<Resource> result) {
490490
String filePath = new File(path).getAbsolutePath();
491491
int prefixIndex = filePath.indexOf(':');
492492
if (prefixIndex == 1) {
493-
// Possibly "c:" drive prefix on Windows, to be upper-cased for proper duplicate detection
494-
filePath = StringUtils.capitalize(filePath);
493+
// Possibly a drive prefix on Windows (for example, "c:"), so we prepend a slash
494+
// and convert the drive letter to uppercase for consistent duplicate detection.
495+
filePath = "/" + StringUtils.capitalize(filePath);
495496
}
496497
// Since '#' can appear in directories/filenames, java.net.URL should not treat it as a fragment
497498
filePath = StringUtils.replace(filePath, "#", "%23");

0 commit comments

Comments
 (0)