patch 9.1.1139: [fifo] is not displayed when editing a fifo
Problem: [fifo] is not displayed when editing a fifo
(after v7.4.2189)
Solution: stat the filename and detect the type correctly
fixes: #16702
closes: #16705
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/fileio.c b/src/fileio.c
index a2031e9..24a01a0 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -366,15 +366,18 @@
goto theend;
}
}
-
- if (!read_stdin && !read_buffer && !read_fifo)
- {
#if defined(UNIX) || defined(VMS)
+ if (!read_stdin && fname != NULL)
/*
* On Unix it is possible to read a directory, so we have to
* check for it before the mch_open().
*/
perm = mch_getperm(fname);
+#endif
+
+ if (!read_stdin && !read_buffer && !read_fifo)
+ {
+#if defined(UNIX) || defined(VMS)
if (perm >= 0 && !S_ISREG(perm) // not a regular file ...
&& !S_ISFIFO(perm) // ... or fifo
&& !S_ISSOCK(perm) // ... or socket