You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
remove_tree("link/") with a trailing slash follows the symlink on macOS/Linux and empties its target #1951
Found reviewing #1863. The POSIX remove_tree walks with lstat and never enters a symlink — except when the top path ends in /: lstat("link/") resolves the link, so the target directory is emptied.
Verified on main (installed with, macOS): a scratch program with target/keep.txt, ln -s target link, then remove_tree("link/") → rc 0, link gone, keep.txt gone.
#1863 fixes the equivalent case on Windows (it strips trailing separators before the reparse-point query), so after it merges Windows is stricter than macOS/Linux. Fix: strip trailing separators from the top path before the lstat in rt/darwin*.w and rt/linux_*.w; a behavior test with a symlink + trailing slash showing the target survives.
Fixed on main by 3044b9c (stack #1979, battery green on 029574d). rt_remove_tree strips the top path's trailing separators before lstat on darwin/linux; behav_1951_remove_tree_symlink_trailing_slash.w red→green.
Activity
POSIX remove_tree strips trailing separators before classifying the t…
POSIX remove_tree strips trailing separators before classifying the t…
Runtime/Windows/fs: remove_tree trailing-slash link (#1951); VecRange…
ehartford commentedon Oct 3, 2026
Fixed on main by 3044b9c (stack #1979, battery green on 029574d). rt_remove_tree strips the top path's trailing separators before lstat on darwin/linux; behav_1951_remove_tree_symlink_trailing_slash.w red→green.