Commit dc13ca6
authored
Fix parent directory creation for absolute POSIX paths (#9777)
The `[^/]+/` match pattern requires at least on non-slash character
before the trailing slash. This works on Windows where absolute paths
start with a drive letter.
With absolute POSIX paths, the leading slash is skipped by this pattern
causing the accumulated `dirStr` to not start with a slash. `dirStr` is
then interpreted as a relative path, causing the directories to be
erroneously created in the current working directory.
This change fixes the erroneous behavior with absolute POSIX paths by
initializing `dirStr` with a slash if the `fullPath` starts with a
slash. It retains the current behavior on Windows systems.1 parent 6d574e1 commit dc13ca6
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
308 | | - | |
| 308 | + | |
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
| |||
0 commit comments