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>
master
Benno Schulenberg 2018-01-15 11:15:05 +01:00
parent 96b47f2877
commit 3981217e5a
1 changed files with 2 additions and 1 deletions

View File

@ -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