mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-19 03:33:43 +03:00
(rm): Work around SunOS 4 bug whereby lstat doesn't fail
when given a zero-length file name argument. Reported by Mark Calabretta <mcalabre@atnf.csiro.au>.
This commit is contained in:
1 parent
d75c1aaea1
commit
5c3c1931dd
1 file changed
+6
-1
@@ -211,7 +211,12 @@ rm (void)
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (lstat (pathname, &path_stats))
|
||||
if (lstat (pathname, &path_stats)
|
||||
/* The following or-clause is solely for systems like SunOS 4.1.3
|
||||
with (broken) lstat that interpret a zero-length file name
|
||||
argument as something meaningful. For such systems, manually
|
||||
set errno to ENOENT. */
|
||||
|| (pathname[0] == '\0' && (errno = ENOENT)))
|
||||
{
|
||||
if (errno == ENOENT && ignore_missing_files)
|
||||
return 0;
|
||||
|
||||
Reference in new issue
Block a user