Do not use INTERNAL_SEPARATOR tokens to separate different parts of an unescaped string when unescape_special is false. This fixes a bug where weird characters would sometimes be printed in completion descriptions

darcs-hash:20061009151913-ac50b-47a9d3274b2399cef6fd0e12a908a606da2c4903.gz
This commit is contained in:
axel 2006-10-10 01:19:13 +10:00
parent 80ac4ddc2b
commit f85ce201ee

View file

@ -1015,7 +1015,8 @@ wchar_t *unescape( const wchar_t * orig, int unescape_special )
default: default:
{ {
in[out_pos++] = INTERNAL_SEPARATOR; if( unescape_special )
in[out_pos++] = INTERNAL_SEPARATOR;
in[out_pos]=in[in_pos]; in[out_pos]=in[in_pos];
break; break;
} }
@ -1140,14 +1141,16 @@ wchar_t *unescape( const wchar_t * orig, int unescape_special )
case L'\'': case L'\'':
{ {
mode = 1; mode = 1;
in[out_pos] = INTERNAL_SEPARATOR; if( unescape_special )
in[out_pos] = INTERNAL_SEPARATOR;
break; break;
} }
case L'\"': case L'\"':
{ {
mode = 2; mode = 2;
in[out_pos] = INTERNAL_SEPARATOR; if( unescape_special )
in[out_pos] = INTERNAL_SEPARATOR;
break; break;
} }
@ -1194,7 +1197,8 @@ wchar_t *unescape( const wchar_t * orig, int unescape_special )
} }
if( c == L'\'' ) if( c == L'\'' )
{ {
in[out_pos] = INTERNAL_SEPARATOR; if( unescape_special )
in[out_pos] = INTERNAL_SEPARATOR;
mode = 0; mode = 0;
} }
else else
@ -1215,7 +1219,8 @@ wchar_t *unescape( const wchar_t * orig, int unescape_special )
case '"': case '"':
{ {
mode = 0; mode = 0;
in[out_pos] = INTERNAL_SEPARATOR; if( unescape_special )
in[out_pos] = INTERNAL_SEPARATOR;
break; break;
} }