(wrong string) ée

From: <git_AT_suckless.org>
Date: Tue, 2 May 2017 00:11:47 +0200 (CEST)

commit 8c5fcaffb6461ef5706f3dc90653f11eb0065734
Author: Mattias Andrée <maandree_AT_kth.se>
AuthorDate: Sun Apr 30 14:12:21 2017 +0200
Commit: Mattias Andrée <maandree_AT_kth.se>
CommitDate: Sun Apr 30 14:12:21 2017 +0200

    Use stdin or stdout (depending on access mode) when opening -
    
    Signed-off-by: Mattias Andrée <maandree_AT_kth.se>

diff --git a/src/util.c b/src/util.c
index 95b46f4..a30f0f0 100644
--- a/src/util.c
+++ b/src/util.c
_AT_@ -243,6 +243,11 @@ xenopen(int status, const char *path, int flags, int mode, ...)
                 return STDOUT_FILENO;
         } else if (!strcmp(path, "/dev/stderr")) {
                 return STDERR_FILENO;
+ } else if (!strcmp(path, "-")) {
+ if ((flags & O_ACCMODE) == O_RDONLY)
+ return STDIN_FILENO;
+ else
+ return STDOUT_FILENO;
         }
         fd = open(path, flags, mode);
         if (fd < 0)
Received on Tue May 02 2017 - 00:11:47 CEST

This archive was generated by hypermail 2.3.0 : Tue May 02 2017 - 00:12:50 CEST