fish-shell/src
Johannes Altmanninger 1b668f5675 Don't use results of quoted command substitution in adjacent variable expansion
Given

    set var a
    echo "$var$(echo b)"

the double-quoted string is expanded right-to-left, so we construct an
intermediate "$varb".  Since the variable "varb" is undefined, this wrongly
expands to the empty string (should be "ab"). Fix this by isolating the
expanded command substitution internally. We do the same when handling
unquoted command substitutions.

Fixes #8849
2022-04-03 11:24:55 +02:00
..
builtins Clean up woption 2022-04-02 11:28:30 -07:00
widecharwidth Update widecharwidth 2022-02-14 22:19:28 +01:00
ast.cpp Rename EXEC_ERR_MSG to INVALID_PIPELINE_CMD_ERR_MSG 2022-03-31 15:49:15 -07:00
ast.h ast.h: remove unused private member finished() 2021-12-12 13:05:48 -08:00
ast_node_types.inc Introduce a new fish ast 2020-07-04 14:58:02 -07:00
autoload.cpp Autoload: Call the parser directly instead of going via "subshell" 2022-03-27 09:35:12 +02:00
autoload.h Run clang-format on all files 2019-10-13 15:50:48 -07:00
builtin.cpp Clean up woption 2022-04-02 11:28:30 -07:00
builtin.h Restyle codebase with clang-format 2021-11-08 12:21:11 -08:00
color.cpp Simplify ASSERT_SORT_ORDER 2021-07-15 13:15:24 -07:00
color.h Refactor color.h/color.cpp 2021-02-08 15:16:21 -06:00
common.cpp Remove some dead code 2022-03-20 14:48:44 -07:00
common.h Remove some dead code 2022-03-20 14:48:44 -07:00
complete.cpp Try to fix the launchpad build 2022-01-26 22:29:06 -08:00
complete.h Tighten up includes, some typedefs -> using 2021-09-21 18:05:53 -07:00
enum_map.h enum_map stuff to enum_map.h 2021-10-01 03:39:43 -07:00
enum_set.h Tighten up includes, some typedefs -> using 2021-09-21 18:05:53 -07:00
env.cpp Let function-scoped variables be queried 2022-03-10 18:28:50 +01:00
env.h Restyle codebase with clang-format 2021-11-08 12:21:11 -08:00
env_dispatch.cpp Overload fish_wcstod for wcstring and length 2022-03-25 16:06:10 +01:00
env_dispatch.h Declare functions in headers or use internal linkage (static) 2020-09-08 22:44:03 +02:00
env_universal_common.cpp Stop migrating legacy uvar paths 2022-03-17 18:15:11 +01:00
env_universal_common.h Stop migrating legacy uvar paths 2022-03-17 18:15:11 +01:00
event.cpp event: Pass name as wcstring 2022-03-25 16:06:10 +01:00
event.h event: Pass name as wcstring 2022-03-25 16:06:10 +01:00
exec.cpp Refactor tty transfer to be more deliberate 2022-03-19 14:48:36 -07:00
exec.h exec.h: remove unused declaration 2021-09-24 09:30:25 -07:00
expand.cpp Don't use results of quoted command substitution in adjacent variable expansion 2022-04-03 11:24:55 +02:00
expand.h Remove expand_flag::skip_home_directories 2021-12-28 15:13:50 -08:00
fallback.cpp Remove wcsndup and wcslcpy 2022-03-17 18:15:11 +01:00
fallback.h Remove wcsndup and wcslcpy 2022-03-17 18:15:11 +01:00
fd_monitor.cpp Correct bug causing early teardown of fd_monitor 2022-03-31 20:41:58 -07:00
fd_monitor.h Correct bug causing early teardown of fd_monitor 2022-03-31 20:41:58 -07:00
fds.cpp Allow using poll() to check for readability 2022-01-02 16:36:33 -08:00
fds.h Allow using poll() to check for readability 2022-01-02 16:36:33 -08:00
fish.cpp Clean up woption 2022-04-02 11:28:30 -07:00
fish_indent.cpp Clean up woption 2022-04-02 11:28:30 -07:00
fish_key_reader.cpp Clean up woption 2022-04-02 11:28:30 -07:00
fish_test_helper.cpp Add a test that stdin is always handed-off as blocking 2022-02-12 11:41:03 -08:00
fish_tests.cpp Rename indent test test_t to indent_test_t 2022-04-02 19:07:27 -07:00
fish_version.cpp Fix build 2021-09-21 18:33:14 -07:00
fish_version.h Revert "Generate FISH_BUILD_VERSION info for cmake builds" 2018-01-08 22:28:10 -08:00
flog.cpp Migrate remaining calls from debug_safe to FLOGF_SAFE 2021-07-05 15:47:56 -07:00
flog.h Migrate remaining calls from debug_safe to FLOGF_SAFE 2021-07-05 15:47:56 -07:00
function.cpp mark some functions static 2021-10-31 03:51:38 -07:00
function.h Continue to refactor functions 2021-10-23 10:12:52 -07:00
future_feature_flags.cpp Fit status feaetures in 80 columns 2021-12-13 01:24:47 -08:00
future_feature_flags.h Make '&' only background if followed by a separating character 2021-07-23 22:58:51 +02:00
global_safety.h Introduce noncopyable_t and nonmovable_t 2021-07-23 11:19:42 -07:00
highlight.cpp highlight: Also use the fallback variable if the main is empty 2022-03-20 17:04:28 +01:00
highlight.h Highlight options differently 2021-10-19 17:20:21 +02:00
history.cpp Switch path_get_data_is_remote to returning a real class enum 2021-12-18 20:48:13 -08:00
history.h history.h: 2021-12-12 13:36:14 -08:00
history_file.cpp Correct a cast when measuring history file size 2022-04-01 10:25:05 -07:00
history_file.h Introduce noncopyable_t and nonmovable_t 2021-07-23 11:19:42 -07:00
input.cpp Prevent signals from tearing multi-char bindings 2022-02-05 13:18:36 -08:00
input.h Stop using thread local vectors 2021-08-10 13:07:13 -07:00
input_common.cpp Prevent signals from tearing multi-char bindings 2022-02-05 13:18:36 -08:00
input_common.h Prevent signals from tearing multi-char bindings 2022-02-05 13:18:36 -08:00
intern.cpp Declare functions in headers or use internal linkage (static) 2020-09-08 22:44:03 +02:00
intern.h restyle intern module to match project style 2016-05-01 20:28:46 -07:00
io.cpp builtin string: don't print final newline if it's missing from stdin 2021-11-27 19:11:24 +01:00
io.h builtin string: don't print final newline if it's missing from stdin 2021-11-27 19:11:24 +01:00
iothread.cpp Call pthread_attr_destroy even if pthread_create failed 2022-02-19 14:15:22 +01:00
iothread.h clang-tidy: run through normal checks 2021-08-21 21:59:05 +02:00
job_group.cpp Remove cancellation groups 2022-03-20 14:39:00 -07:00
job_group.h Remove cancellation groups 2022-03-20 14:39:00 -07:00
kill.cpp Make the kill ring thread-safe 2021-04-21 17:37:44 -07:00
kill.h Implementation of variable with killring entries 2021-04-21 16:39:29 -07:00
lru.h Restyle codebase with clang-format 2021-11-08 12:21:11 -08:00
maybe.h maybe.h: reference header new 2021-08-17 18:57:16 -05:00
null_terminated_array.cpp Rework null terminated arrays 2021-03-28 15:31:25 -07:00
null_terminated_array.h Introduce noncopyable_t and nonmovable_t 2021-07-23 11:19:42 -07:00
operation_context.cpp Allow specifying a limit on number of expansion in operation_context 2020-12-22 12:38:51 -08:00
operation_context.h Expand more when performing history path detection 2021-01-08 12:58:34 -08:00
output.cpp Fix tparm kludge 2022-03-14 15:36:17 +01:00
output.h Tighten up includes, some typedefs -> using 2021-09-21 18:05:53 -07:00
pager.cpp Wrap even more stuff in anonymous namespaces 2021-09-30 11:33:03 -07:00
pager.h Revert "Attempt to simplify how completions get presented in the pager" 2020-12-04 16:44:48 +01:00
parse_constants.h Use source_offset_t (uint32) in tokenizer. 2021-12-21 02:32:52 -08:00
parse_execution.cpp Move executable-check to C++ 2022-03-31 15:16:01 +02:00
parse_execution.h Remove cancellation groups 2022-03-20 14:39:00 -07:00
parse_tree.cpp Rename EXEC_ERR_MSG to INVALID_PIPELINE_CMD_ERR_MSG 2022-03-31 15:49:15 -07:00
parse_tree.h Rename EXEC_ERR_MSG to INVALID_PIPELINE_CMD_ERR_MSG 2022-03-31 15:49:15 -07:00
parse_util.cpp Emit an error if time is used past the first command in a pipeline 2022-03-31 16:14:59 -07:00
parse_util.h Fix error check for repeated quoted command substitution 2021-12-04 16:56:07 +01:00
parser.cpp Migrate 'within_fish_init' to a parser-local variable 2022-03-24 21:43:58 -07:00
parser.h Migrate 'within_fish_init' to a parser-local variable 2022-03-24 21:43:58 -07:00
parser_keywords.cpp builtin _ is now a reserved keyword 2021-10-11 00:27:44 -07:00
parser_keywords.h Make IWYU output in lint.cpp less messy 2016-06-23 17:26:08 -07:00
path.cpp Move executable-check to C++ 2022-03-31 15:16:01 +02:00
path.h Switch path_get_data_is_remote to returning a real class enum 2021-12-18 20:48:13 -08:00
postfork.cpp Refactor tty transfer to be more deliberate 2022-03-19 14:48:36 -07:00
postfork.h Refactor tty transfer to be more deliberate 2022-03-19 14:48:36 -07:00
print_help.cpp Run clang-format on all files 2019-10-13 15:50:48 -07:00
print_help.h restyle proc module to match project style 2016-05-02 22:07:58 -07:00
proc.cpp Fix job run flog 2022-03-21 16:26:01 +01:00
proc.h Migrate 'within_fish_init' to a parser-local variable 2022-03-24 21:43:58 -07:00
reader.cpp reader: Some light stringification 2022-03-25 16:06:10 +01:00
reader.h read: Actually only fire fish_read, not fish_prompt event 2022-03-16 20:14:59 +01:00
redirection.cpp Collapse io_data switch statements 2019-12-29 15:51:22 -08:00
redirection.h Introduce noncopyable_t and nonmovable_t 2021-07-23 11:19:42 -07:00
screen.cpp Fix tparm kludge 2022-03-14 15:36:17 +01:00
screen.h Restyle codebase with clang-format 2021-11-08 12:21:11 -08:00
signal.cpp Tighten up includes, some typedefs -> using 2021-09-21 18:05:53 -07:00
signal.h Restyle codebase with clang-format 2021-11-08 12:21:11 -08:00
termsize.cpp Include <termios.h> instead of <sys/termios.h>. 2021-03-02 12:05:07 +01:00
termsize.h Eliminate the termsize handling from common.h 2020-06-07 20:00:42 -07:00
timer.cpp Revert changes to time formatting 2022-02-21 22:48:43 +01:00
timer.h Pass some parameters by reference/move 2021-03-21 19:41:36 +01:00
tinyexpr.cpp Merge branch 'master' into te-refactor 2022-03-13 11:24:31 +01:00
tinyexpr.h math: Use wchar 2020-12-14 22:54:53 +01:00
tokenizer.cpp Remove some dead code 2022-03-20 14:48:44 -07:00
tokenizer.h Remove some dead code 2022-03-20 14:48:44 -07:00
topic_monitor.cpp Allow using poll() to check for readability 2022-01-02 16:36:33 -08:00
topic_monitor.h Introduce noncopyable_t and nonmovable_t 2021-07-23 11:19:42 -07:00
trace.cpp Restyle codebase with clang-format 2021-11-08 12:21:11 -08:00
trace.h Cache if tracing is enabled 2021-10-28 19:39:30 +02:00
utf8.cpp Change C casts to C++ ones 2020-05-01 13:30:56 -07:00
utf8.h [clang-tidy] Fix inconsistent declarations 2019-11-25 14:13:33 -08:00
util.cpp wcsfilecmp: Stop actually computing the numbers 2021-10-07 17:57:52 +02:00
util.h Return glob ordering to pre-3.1 state 2020-02-14 19:06:19 +01:00
wait_handle.cpp Refactor wait handles 2021-05-17 15:25:21 -07:00
wait_handle.h Mild refactoring of wait handles 2021-10-28 10:37:43 -07:00
wcstringutil.cpp fish_wcswidth_visible to use int instead of size_t 2022-02-07 22:17:47 -08:00
wcstringutil.h Restyle codebase with clang-format 2021-11-08 12:21:11 -08:00
wgetopt.cpp Make arguments to builtins const 2021-03-28 15:31:25 -07:00
wgetopt.h Clean up woption 2022-04-02 11:28:30 -07:00
wildcard.cpp Clean up wildcard_has 2021-11-27 12:48:04 -08:00
wildcard.h Clean up wildcard_has 2021-11-27 12:48:04 -08:00
wutil.cpp Overload fish_wcstod for wcstring and length 2022-03-25 16:06:10 +01:00
wutil.h Overload fish_wcstod for wcstring and length 2022-03-25 16:06:10 +01:00