From 62b76b26b4a8afc6987b65f0ad02a18dee093f2e Mon Sep 17 00:00:00 2001 From: Andreas Nordal Date: Mon, 8 Feb 2016 19:49:26 +0100 Subject: Reinstate failglob behaviour for most commands Expand globs to zero arguments (nullglob) only for set, for and count. The warning about failing globs, and setting the accompanying $status, now happens regardless of mode, interactive or not. It is assumed that the above commands are the common cases where nullglob behaviour is desirable. More importantly, doing this with `set` is a real feature enabler, since the resulting empty array can be passed on to any command. The previous behaviour was actually all nullglob (since commit cab115c8b9933ae7db9412c66d452c0ccb2d7152), but this was undocumented; the failglob warning was still printed in interactive mode, and the documentation was bragging about failglob behaviour. --- src/parse_execution.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/parse_execution.h') diff --git a/src/parse_execution.h b/src/parse_execution.h index 7e1c1f46..a9ce32f5 100644 --- a/src/parse_execution.h +++ b/src/parse_execution.h @@ -102,7 +102,12 @@ private: parse_execution_result_t run_function_statement(const parse_node_t &header, const parse_node_t &block_end_command); parse_execution_result_t run_begin_statement(const parse_node_t &header, const parse_node_t &contents); - parse_execution_result_t determine_arguments(const parse_node_t &parent, wcstring_list_t *out_arguments); + enum globspec_t + { + failglob, + nullglob + }; + parse_execution_result_t determine_arguments(const parse_node_t &parent, wcstring_list_t *out_arguments, globspec_t glob_behavior); /* Determines the IO chain. Returns true on success, false on error */ bool determine_io_chain(const parse_node_t &statement, io_chain_t *out_chain); -- cgit v1.2.3