Add support for \cx backslash escapes for control sequences, syntax is borrowed from bash

darcs-hash:20060831155813-ac50b-cc93412afc87c1c391c3dbc5e7b8c9175efe01d8.gz
This commit is contained in:
axel 2006-09-01 01:58:13 +10:00
parent b6e8171f01
commit 6de0c4103b

View File

@ -866,6 +866,29 @@ wchar_t *unescape( const wchar_t * orig, int unescape_special )
in[out_pos]=L'\x1b';
break;
}
case L'c':
{
in_pos++;
if( in[in_pos] >= L'a' &&
in[in_pos] <= (L'a'+32) )
{
in[out_pos]=in[in_pos]-L'a'+1;
}
else if( in[in_pos] >= L'A' &&
in[in_pos] <= (L'A'+32) )
{
in[out_pos]=in[in_pos]-L'A'+1;
}
else
{
free(in);
return 0;
}
break;
}
case L'u':
case L'U':