rm would prompt for non-dangling symlinks

(prompt): When not interactive, don't prompt for a symlink.
This commit is contained in:
Jim Meyering 2002-07-22 06:59:26 +00:00
parent fc1b595b19
commit db6dff2e6e

View File

@ -574,7 +574,11 @@ prompt (char const *filename, struct rm_options const *x,
/* Using permissions doesn't make sense for symlinks. */
if (S_ISLNK (sbuf.st_mode))
write_protected = 0;
{
if ( ! x->interactive)
return RM_OK;
write_protected = 0;
}
/* Issue the prompt. */
{