From 143602e5f6653011230d377c299427bcde1fbb66 Mon Sep 17 00:00:00 2001 From: axel Date: Wed, 15 Feb 2006 12:49:00 +1000 Subject: [PATCH] Minor edits darcs-hash:20060215024900-ac50b-51863879c32660d9787db706c34fef10aa4c30c2.gz --- builtin.c | 1 + builtin_complete.c | 146 ++++++++++++++++++++++----------------------- reader.c | 2 +- 3 files changed, 74 insertions(+), 75 deletions(-) diff --git a/builtin.c b/builtin.c index 9e985fd35..1ace760be 100644 --- a/builtin.c +++ b/builtin.c @@ -3175,6 +3175,7 @@ void builtin_destroy() { hash_destroy( desc ); free( desc ); + desc=0; } al_destroy( &io_stack ); diff --git a/builtin_complete.c b/builtin_complete.c index 1e3ef7ebd..e9f315aa7 100644 --- a/builtin_complete.c +++ b/builtin_complete.c @@ -27,7 +27,7 @@ const static wchar_t *temporary_buffer; /* builtin_complete_* are a set of rather silly looping functions that make sure that all the proper combinations of complete_add or - complete_remove get called. + complete_remove get called. */ static void builtin_complete_add2( const wchar_t *cmd, @@ -307,7 +307,8 @@ int builtin_complete( wchar_t **argv ) } , { - L"long-option", required_argument, 0, 'l' } + L"long-option", required_argument, 0, 'l' + } , { L"old-option", required_argument, 0, 'o' @@ -415,10 +416,8 @@ int builtin_complete( wchar_t **argv ) comp = woptarg; break; - case 'e': remove = 1; - break; case 'n': @@ -441,86 +440,85 @@ int builtin_complete( wchar_t **argv ) } - if( res != 0 ) + if( !res ) { - } - else if( do_complete ) - { - array_list_t comp; - int i; - - const wchar_t *prev_temporary_buffer = temporary_buffer; - temporary_buffer = do_complete; - - if( recursion_level < 1 ) + if( do_complete ) { - recursion_level++; + array_list_t comp; + int i; + + const wchar_t *prev_temporary_buffer = temporary_buffer; + temporary_buffer = do_complete; + + if( recursion_level < 1 ) + { + recursion_level++; + al_init( &comp ); + + complete( do_complete, &comp ); + + for( i=0; i