File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -161,8 +161,8 @@ split-path: func [
161
161
target [file! url! string! ]
162
162
/local dir pos
163
163
] [
164
- parse/all target [
165
- [#"/" | 1 2 #"." opt #"/" ] end (dir: dirize target) |
164
+ parse target [
165
+ [#"/" | 1 2 #"." opt #"/" ] end (pos: %"" dir: dirize target) |
166
166
pos: any [thru #"/" [end | pos: ]] (
167
167
all [empty? dir: copy/part target at head target index? pos dir: %./ ]
168
168
all [find [%. %.. ] pos: to file! pos insert tail pos #"/" ]
Original file line number Diff line number Diff line change @@ -1891,6 +1891,10 @@ Rebol [
1891
1891
--assert [%./ %dir ] = split-path %dir
1892
1892
--assert [%./ %dir/ ] = split-path %dir/
1893
1893
--assert [%dir/ %file.txt ] = split-path %dir/file.txt
1894
+ ;@@ https://github.com/Oldes/Rebol-issues/issues/2474
1895
+ --assert [%/ %"" ] = split-path %/
1896
+ --assert [%./ %"" ] = split-path %./
1897
+ --assert [%../ %"" ] = split-path %../
1894
1898
--test-- "split-path url!"
1895
1899
--assert [http://foo.net/ %aa.txt ] = split-path http://foo.net/aa.txt
1896
1900
--assert [http:// %foo.net/ ] = split-path http://foo.net/ ;@@ could be better result!
You can’t perform that action at this time.
0 commit comments