1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:07:34 +00:00

rm: When invoked on a symlink, remove the symlink itself

This commit is contained in:
Andreas Kling 2020-01-10 12:49:36 +01:00
parent 8f20b173fd
commit f026f0f4bb

View file

@ -12,9 +12,8 @@
int remove(bool recursive, const char* path)
{
struct stat path_stat;
int s = stat(path, &path_stat);
if (s < 0) {
perror("stat");
if (lstat(path, &path_stat) < 0) {
perror("lstat");
return 1;
}