From eaa87ff88561982f139f86490b18a37f5dec1b59 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Tue, 10 Dec 2019 16:14:34 -0800 Subject: [PATCH] Correct a comment A comment claimed that 0 was STDOUT_FILENO. In fact this should be 1. Also default the fd for pipe_or_redir_t to -1, as 0 is not a sensible default. --- src/tokenizer.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tokenizer.h b/src/tokenizer.h index fada16eec..5e6e3a12b 100644 --- a/src/tokenizer.h +++ b/src/tokenizer.h @@ -154,9 +154,9 @@ wcstring tok_first(const wcstring &str); /// Struct wrapping up a parsed pipe or redirection. struct pipe_or_redir_t { // The redirected fd, or -1 on overflow. - // In the common case of a pipe, this is 0 (STDOUT_FILENO). + // In the common case of a pipe, this is 1 (STDOUT_FILENO). // For example, in the case of "3>&1" this will be 3. - int fd{0}; + int fd{-1}; // Whether we are a pipe (true) or redirection (false). bool is_pipe{false};