mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-01-19 18:22:45 +08:00
Return the previous logic for '\\'.
The following expression now works: ```sh switch '\\' case '\\' echo 1 end ``` Due to ambiguity, the following expression also works: ```sh switch '\a' case '\\a' echo 1 end ``` By the way, the following expression now doesn't work, which was not the case before, because of wrong escaping: ```sh switch 'nn' case '\n' echo 1 end ```
This commit is contained in:
parent
ea4b37d5c5
commit
01d8490255
|
@ -660,11 +660,28 @@ wchar_t *parse_util_unescape_wildcards( const wchar_t *str )
|
|||
{
|
||||
case L'\\':
|
||||
{
|
||||
if( *(in+1) )
|
||||
{
|
||||
in++;
|
||||
*(out++)=*in;
|
||||
}
|
||||
switch ( *(in + 1) )
|
||||
{
|
||||
case L'*':
|
||||
case L'?':
|
||||
{
|
||||
in++;
|
||||
*(out++)=*in;
|
||||
break;
|
||||
}
|
||||
case L'\\':
|
||||
{
|
||||
in++;
|
||||
*(out++)=L'\\';
|
||||
*(out++)=L'\\';
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
*(out++)=*in;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user