mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-01 22:57:14 +08:00
Make sure inserted completions are escaped, even when case insensitive
darcs-hash:20080109000046-75c98-baf9ef4594ad0c7024a79b5c4819c10c0697ba47.gz
This commit is contained in:
parent
9c38ed8238
commit
5379200b9e
8
reader.c
8
reader.c
|
@ -967,6 +967,7 @@ static void completion_insert( const wchar_t *val, int flags )
|
|||
int tok_start, tok_len;
|
||||
wchar_t *begin, *end;
|
||||
string_buffer_t sb;
|
||||
wchar_t *escaped;
|
||||
|
||||
parse_util_token_extent( data->buff, data->buff_pos, &begin, 0, 0, 0 );
|
||||
end = data->buff+data->buff_pos;
|
||||
|
@ -976,7 +977,12 @@ static void completion_insert( const wchar_t *val, int flags )
|
|||
|
||||
sb_init( &sb );
|
||||
sb_append_substring( &sb, data->buff, begin - data->buff );
|
||||
sb_append( &sb, val );
|
||||
|
||||
escaped = escape( val, ESCAPE_ALL | ESCAPE_NO_QUOTED );
|
||||
|
||||
sb_append( &sb, escaped );
|
||||
free( escaped );
|
||||
|
||||
if( add_space )
|
||||
{
|
||||
sb_append( &sb, L" " );
|
||||
|
|
Loading…
Reference in New Issue
Block a user