Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 075ed31

Browse files
committedSep 10, 2021
Stricter Windows splitdrive patterns.
1 parent 261969a commit 075ed31

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed
 

Diff for: ‎base/path.jl

+5-3
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,12 @@ elseif Sys.iswindows()
3737
const splitdrive_re = let
3838
# Slash in either direction.
3939
S = raw"[\\/]"
40-
# Not a slash in either direction.
41-
N = raw"[^\\/]"
40+
# Not a slash in either direction, or any of the other
41+
# reserved characters from
42+
# https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions.
43+
N = raw"[^\\/<>:\"|?*]"
4244
# Drive letter, e.g. `C:`
43-
drive = "$(N)+:"
45+
drive = "[a-zA-Z]:"
4446
# UNC path, e.g. `\\server\share`
4547
unc = "$(S)$(S)$(N)+$(S)$(N)+"
4648
# Long drive letter, e.g. `\\?\C:`

0 commit comments

Comments
 (0)
Please sign in to comment.