Fisx crash buh when completing string ending in backslash

darcs-hash:20051225220044-ac50b-b880ffe649d04ed1e5ec6786d0b59eed8068d182.gz
This commit is contained in:
axel
2005-12-26 08:00:44 +10:00
parent b6630b5087
commit b37eeb92ef
6 changed files with 49 additions and 22 deletions

View File

@@ -2017,7 +2017,7 @@ void complete( const wchar_t *cmd,
tok_init( &tok, buff, TOK_ACCEPT_UNFINISHED );
while( !end_loop )
while( tok_has_next( &tok) && !end_loop )
{
switch( tok_last_type( &tok ) )
{
@@ -2063,7 +2063,8 @@ void complete( const wchar_t *cmd,
reader_current_token_extent( &begin, &end, &prev_begin, &prev_end );
current_token = wcsndup( begin, reader_get_cursor_pos()-(begin-reader_get_buffer()) );
prev_token = wcsndup( prev_begin, prev_end - prev_begin );
prev_token = prev_begin ? wcsndup( prev_begin, prev_end - prev_begin ): wcsdup(L"");
// fwprintf( stderr, L"on_command: %d, %ls %ls\n", on_command, current_compmand, current_token );