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:
maxfl 2012-07-02 11:52:18 +08:00 committed by ridiculousfish
parent ea4b37d5c5
commit 01d8490255

View File

@ -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;
}