From 4d5c50cbb32506db8c4aa53ba804faf32e5015a5 Mon Sep 17 00:00:00 2001 From: axel Date: Sat, 21 Apr 2007 05:34:30 +1000 Subject: Fix minor bug - the description would occasionally get appended to command specific tab completions in case insensitive mode darcs-hash:20070420193430-ac50b-13e34ac41cf1662a74f0af329fb41d872df5d691.gz --- wildcard.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'wildcard.c') diff --git a/wildcard.c b/wildcard.c index 41f8f1b6..73c715a6 100644 --- a/wildcard.c +++ b/wildcard.c @@ -256,6 +256,15 @@ static int wildcard_complete_internal( const wchar_t *orig, return 1; } + if( flags & COMPLETE_NO_CASE ) + { + out_completion = wcsdup( orig ); + } + else + { + out_completion = wcsdup( str ); + } + if( wcschr( str, PROG_COMPLETE_SEP ) ) { /* @@ -263,10 +272,10 @@ static int wildcard_complete_internal( const wchar_t *orig, */ wchar_t *sep; - out_completion = wcsdup( str ); sep = wcschr(out_completion, PROG_COMPLETE_SEP ); *sep = 0; out_desc = sep + 1; + } else { @@ -282,16 +291,6 @@ static int wildcard_complete_internal( const wchar_t *orig, out_desc = func_desc; } - /* - Append description to item, if a description exists - */ - out_completion = wcsdup( str ); - } - - if( flags & COMPLETE_NO_CASE ) - { - free( out_completion ); - out_completion = wcsdup( orig ); } if( out_completion ) @@ -1217,7 +1216,9 @@ int wildcard_expand( const wchar_t *wc, sb_destroy( &sb ); if( wc_base_ptr ) + { free( wc_base ); + } } return res; -- cgit v1.2.3