commit 3981217e5a19eaad6544eaaebd151b5f22a76edc
parent 96b47f287740f7663dc763149b0747f2fbc86a1a
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Mon, 15 Jan 2018 11:15:05 +0100
startup: allow a named pipe as file argument when --noread is used
This fixes https://savannah.gnu.org/bugs/?52896.
Reported-by: Miki Strange <mik@mikistrange.com>
Tested-by: Miki Strange <mik@mikistrange.com>
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/files.c b/src/files.c
@@ -435,7 +435,8 @@ bool open_buffer(const char *filename, bool undoable)
if (strcmp(filename, "") != 0) {
struct stat fileinfo;
- if (stat(realname, &fileinfo) == 0 && !S_ISREG(fileinfo.st_mode)) {
+ if (stat(realname, &fileinfo) == 0 && !(S_ISREG(fileinfo.st_mode) ||
+ (ISSET(NOREAD_MODE) && S_ISFIFO(fileinfo.st_mode)))) {
if (S_ISDIR(fileinfo.st_mode))
statusline(ALERT, _("\"%s\" is a directory"), realname);
else