1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-20 15:44:49 +00:00

Merge pull request #354 from andrewchambers/safeclean

Do not recurse into symlinks when cleaning.
This commit is contained in:
Calvin Rose 2020-04-21 13:21:42 -04:00 committed by GitHub
commit 13559baecc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -267,7 +267,7 @@
"Remove a directory and all sub directories."
[path]
(try
(if (= (os/stat path :mode) :directory)
(if (= (os/lstat path :mode) :directory)
(do
(each subpath (os/dir path)
(rm (string path sep subpath)))