summaryrefslogtreecommitdiff
path: root/user/the_silver_searcher/pipe-symlink.patch
blob: ee47f9439e37d1329de874f452e00988c9cde78f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
From 095c3f091e23fda1d9d00bd42c38cf81bba1c14f Mon Sep 17 00:00:00 2001
From: Jacob Wahlgren <jacob@dstsrc.net>
Date: Wed, 28 Nov 2018 23:35:52 +0100
Subject: [PATCH] Skip symlinks to named pipes

The d_type field contains the type as lstat would put it, but when
checking for a named pipe we need the stat behavior.

Fixes https://github.com/ggreer/the_silver_searcher/issues/1272
---
 src/util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util.c b/src/util.c
index cb23914d3..3949477b2 100644
--- a/src/util.c
+++ b/src/util.c
@@ -516,7 +516,7 @@ int is_symlink(const char *path, const struct dirent *d) {
 
 int is_named_pipe(const char *path, const struct dirent *d) {
 #ifdef HAVE_DIRENT_DTYPE
-    if (d->d_type != DT_UNKNOWN) {
+    if (d->d_type != DT_UNKNOWN && d->d_type != DT_LNK) {
         return d->d_type == DT_FIFO || d->d_type == DT_SOCK;
     }
 #endif