Fix explode_path to work on absolute paths
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
This commit is contained in:
parent
270e1ce846
commit
da469e66f0
|
@ -2,11 +2,12 @@ let explode_path =
|
||||||
let rec loop path acc =
|
let rec loop path acc =
|
||||||
let dir = Filename.dirname path in
|
let dir = Filename.dirname path in
|
||||||
let base = Filename.basename path in
|
let base = Filename.basename path in
|
||||||
let acc = base :: acc in
|
|
||||||
if dir = Filename.current_dir_name then
|
if dir = Filename.current_dir_name then
|
||||||
|
base :: acc
|
||||||
|
else if dir = path then
|
||||||
acc
|
acc
|
||||||
else
|
else
|
||||||
loop dir acc
|
loop dir (base :: acc)
|
||||||
in
|
in
|
||||||
fun path -> loop path []
|
fun path -> loop path []
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue