summaryrefslogtreecommitdiff
path: root/user/the_silver_searcher/pipe-symlink.patch
diff options
context:
space:
mode:
Diffstat (limited to 'user/the_silver_searcher/pipe-symlink.patch')
-rw-r--r--user/the_silver_searcher/pipe-symlink.patch26
1 files changed, 26 insertions, 0 deletions
diff --git a/user/the_silver_searcher/pipe-symlink.patch b/user/the_silver_searcher/pipe-symlink.patch
new file mode 100644
index 000000000..ee47f9439
--- /dev/null
+++ b/user/the_silver_searcher/pipe-symlink.patch
@@ -0,0 +1,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