mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-28 12:13:55 +08:00
expand_abbreviation(): escape when looking up abbreviation vars
This was doing exactly the opposite: unescaping and not hitting the encoded _fish_abbr_X variables when looking up. Fixes #5573
This commit is contained in:
parent
65bc94c493
commit
7e514d2aa5
|
@ -1180,11 +1180,11 @@ bool fish_xdm_login_hack_hack_hack_hack(std::vector<std::string> *cmds, int argc
|
|||
maybe_t<wcstring> expand_abbreviation(const wcstring &src, const environment_t &vars) {
|
||||
if (src.empty()) return none();
|
||||
|
||||
wcstring unesc_src;
|
||||
if (!unescape_string(src, &unesc_src, STRING_STYLE_VAR)) {
|
||||
wcstring esc_src = escape_string(src, 0, STRING_STYLE_VAR);
|
||||
if (esc_src.empty()) {
|
||||
return none();
|
||||
}
|
||||
wcstring var_name = L"_fish_abbr_" + unesc_src;
|
||||
wcstring var_name = L"_fish_abbr_" + esc_src;
|
||||
if (auto var_value = vars.get(var_name)) {
|
||||
return var_value->as_string();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user