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.
This commit is contained in:
ridiculousfish 2019-12-10 16:14:34 -08:00
parent 6b2addd9f3
commit eaa87ff885

View File

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