1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-11 18:20:43 +09:00

LibC: Prevent remove from calling rmdir when unlink succeeds.

This commit is contained in:
Mart G 2021-01-23 13:21:42 +01:00 committed by Andreas Kling
parent 8363b3ae99
commit 86a9e26996
Notes: sideshowbarker 2024-07-18 22:55:53 +09:00

View file

@ -1152,9 +1152,9 @@ int pclose(FILE* stream)
int remove(const char* pathname)
{
int rc = unlink(pathname);
if (rc < 0 && errno != EISDIR)
return -1;
return rmdir(pathname);
if (rc < 0 && errno == EISDIR)
return rmdir(pathname);
return rc;
}
int scanf(const char* fmt, ...)