Skip to content

escapeWindowsPath() can produce ambiguous output and misses relative paths #355

Description

@elharo

In src/main/java/org/apache/maven/shared/filtering/FilteringUtils.java, lines 81–100:

The regex ^(.*)[a-zA-Z]:\\\\\\(.*) only matches absolute Windows paths containing a drive letter. Relative paths with backslashes (e.g., src\\main\\java) are never escaped. The single/double backslash deduplication logic at line 90 (if (val.indexOf('\\', end + 1) == end + 1)) also means that C:\\foo\\bar and C:\\foo\\\\bar both produce the same output C:\\\\\\\\foo\\\\\\\\bar — information is lost about whether the original had single or double backslashes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions