mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-27 11:23:43 +08:00
Make escaped strings more readable
darcs-hash:20070925161916-75c98-c33aa140fb099f2003e5af3dadb5f613075b59d6.gz
This commit is contained in:
parent
cf8e746d0c
commit
5694d3f027
19
common.c
19
common.c
|
@ -795,6 +795,13 @@ wchar_t *escape( const wchar_t *in_orig,
|
|||
need_escape=need_complex_escape=1;
|
||||
break;
|
||||
|
||||
case L'\x1b':
|
||||
*(pos++) = L'\\';
|
||||
*(pos++) = L'e';
|
||||
need_escape=need_complex_escape=1;
|
||||
break;
|
||||
|
||||
|
||||
case L'\\':
|
||||
case L'\'':
|
||||
{
|
||||
|
@ -837,6 +844,18 @@ wchar_t *escape( const wchar_t *in_orig,
|
|||
{
|
||||
if( *in < 32 )
|
||||
{
|
||||
if( *in <27 && *in > 0 )
|
||||
{
|
||||
*(pos++) = L'\\';
|
||||
*(pos++) = L'c';
|
||||
*(pos++) = L'a' + *in -1;
|
||||
|
||||
need_escape=need_complex_escape=1;
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
int tmp = (*in)%16;
|
||||
*pos++ = L'\\';
|
||||
*pos++ = L'x';
|
||||
|
|
Loading…
Reference in New Issue
Block a user