aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/io.h
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2015-09-25 14:17:53 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2015-09-25 14:19:15 -0700
commitabeaac66328f83d8962d6a5a4b9ce8712edbbaa5 (patch)
tree72ee133f395935a0ffe977f6a6f189dfb5314628 /src/io.h
parentd591cebf4463e42569400bbcbaba5e16dcad734b (diff)
Teach builtin_string to recognize redirections, not just pipes
Allows cases like `string split \n < file.txt` to work. Fixes 2422
Diffstat (limited to 'src/io.h')
-rw-r--r--src/io.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/io.h b/src/io.h
index 8d12f685..bb4c0621 100644
--- a/src/io.h
+++ b/src/io.h
@@ -288,8 +288,9 @@ struct io_streams_t
// fd representing stdin. This is not closed by the destructor.
int stdin_fd;
- // Whether this is the first process in a pipeline
- bool is_first_process_in_pipeline;
+ // Whether stdin is "directly redirected," meaning it is the recipient of a pipe (foo | cmd) or direct redirection (cmd < foo.txt)
+ // An "indirect redirection" would be e.g. begin ; cmd ; end < foo.txt
+ bool stdin_is_directly_redirected;
// Indicates whether stdout and stderr are redirected (e.g. to a file or piped)
bool out_is_redirected;
@@ -298,7 +299,7 @@ struct io_streams_t
// Actual IO redirections. This is only used by the source builtin. Unowned.
const io_chain_t *io_chain;
- io_streams_t() : stdin_fd(-1), is_first_process_in_pipeline(false), out_is_redirected(false), err_is_redirected(false), io_chain(NULL)
+ io_streams_t() : stdin_fd(-1), stdin_is_directly_redirected(false), out_is_redirected(false), err_is_redirected(false), io_chain(NULL)
{
}
};