mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-29 18:51:15 -03:00
funced: avoid interpreting special characters in function name
Commit c3374ffd0 ("Use read --tokenize instead of eval for $BROWSER &
$EDITOR") converted uses of "eval" for environment variables to use the
safer "read -at", which performs word splitting but no other expansion.
funced contained a leftover instance of "eval". Remove it in favor
of using the editor command that was already word-split.
This means that we don't accidentally evaluate the file name.
(Also "set -gx EDITOR=~/my-editor" won't work anymore because the ~
is not expanded anymore but no one has complained about that behavior
in edit_command_buffer.)
Fixes #8289
This commit is contained in:
@@ -101,7 +101,7 @@ function funced --description 'Edit function definition'
|
||||
while true
|
||||
set -l checksum (__funced_md5 "$tmpname")
|
||||
|
||||
if not eval $editor $tmpname
|
||||
if not $editor_cmd $tmpname
|
||||
echo (_ "Editing failed or was cancelled")
|
||||
else
|
||||
# Verify the checksum (if present) to detect potential problems
|
||||
|
||||
Reference in New Issue
Block a user