]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
rm would prompt for non-dangling symlinks
authorJim Meyering <jim@meyering.net>
Mon, 22 Jul 2002 06:59:26 +0000 (06:59 +0000)
committerJim Meyering <jim@meyering.net>
Mon, 22 Jul 2002 06:59:26 +0000 (06:59 +0000)
(prompt): When not interactive, don't prompt for a symlink.

src/remove.c

index 8fa482e05079a18f2ce2c499339aa75a1461a848..59368ac09abad70048256d43439cc92dd372134b 100644 (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.  */
       {