Skip to content

Commit

Permalink
Fix Run.rm_rf w.r.t. symlinks
Browse files Browse the repository at this point in the history
Sys.is_directory raises if called on a dangling symlink.
  • Loading branch information
dra27 committed Mar 16, 2021
1 parent 4403309 commit 808c6a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/reftests/run.ml
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ let erase_file path =

let rm_rf path =
let rec erase path =
if Sys.is_directory path then begin
if Sys.file_exists path && Sys.is_directory path then begin
Array.iter (fun entry -> erase (Filename.concat path entry))
(Sys.readdir path);
Unix.rmdir path
Expand Down

0 comments on commit 808c6a5

Please sign in to comment.