From e673a685aca492fc14e5c5e1354848620a660325 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 22 Jan 2001 10:51:54 +0000 Subject: (remove_file): Correct an expression to avoid making an unnecessary call to euidaccess for each file. --- src/remove.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/remove.c') diff --git a/src/remove.c b/src/remove.c index 4b1ab3033..2e31323ab 100644 --- a/src/remove.c +++ b/src/remove.c @@ -1,5 +1,5 @@ /* remove.c -- core functions for removing files and directories - Copyright (C) 88, 90, 91, 1994-2000 Free Software Foundation, Inc. + Copyright (C) 88, 90, 91, 1994-2001 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -615,7 +615,7 @@ remove_file (struct File_spec *fs, const struct rm_options *x) int asked = 0; char *pathname = fs->filename; - if (!x->ignore_missing_files && (x->interactive || x->stdin_tty) + if (!x->ignore_missing_files && x->interactive && x->stdin_tty && euidaccess (pathname, W_OK)) { if (!S_ISLNK (fspec_filetype_mode (fs))) -- cgit v1.2.3-54-g00ecf