mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-29 10:31:14 -03:00
Make escape_string transform wildcard characters
The characters ANY_CHAR, ANY_STRING, and ANY_STRING_RECURSIVE are currently transformed by unescape, but not by escape. Let's try escaping them. Fixes #1614.
This commit is contained in:
15
common.cpp
15
common.cpp
@@ -1019,7 +1019,22 @@ static void escape_string_internal(const wchar_t *orig_in, size_t in_len, wcstri
|
||||
out += *in;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// Experimental fix for #1614
|
||||
// The hope is that any time these appear in a string, they came from wildcard expansion
|
||||
case ANY_CHAR:
|
||||
out += L'?';
|
||||
break;
|
||||
|
||||
case ANY_STRING:
|
||||
out += L'*';
|
||||
break;
|
||||
|
||||
case ANY_STRING_RECURSIVE:
|
||||
out += L"**";
|
||||
break;
|
||||
|
||||
case L'&':
|
||||
case L'$':
|
||||
case L' ':
|
||||
|
||||
Reference in New Issue
Block a user