aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debianutils/which.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/debianutils/which.c b/debianutils/which.c
index 27646d520..120f1e72f 100644
--- a/debianutils/which.c
+++ b/debianutils/which.c
@@ -30,7 +30,9 @@ static int file_exists(char *file)
30{ 30{
31 struct stat filestat; 31 struct stat filestat;
32 32
33 if (stat(file, &filestat) == 0 && filestat.st_mode & S_IXUSR) 33 if (stat(file, &filestat) == 0 &&
34 S_ISREG(filestat.st_mode) &&
35 filestat.st_mode & S_IXUSR)
34 return 1; 36 return 1;
35 else 37 else
36 return 0; 38 return 0;