diff options
author | axel <axel@liljencrantz.se> | 2006-01-23 09:30:00 +1000 |
---|---|---|
committer | axel <axel@liljencrantz.se> | 2006-01-23 09:30:00 +1000 |
commit | 0ccc657aa6ad410fd047dc88cdb302252edb5ebf (patch) | |
tree | 9f02b170c5b282ad488d65143fdeb1b17c2d0bd1 /builtin_complete.c | |
parent | 7f01570cafa00f015c9869d3282905327109a3d9 (diff) |
Fix bug from the modified completion builtin where a completion that specified no switches would be ignored
darcs-hash:20060122233000-ac50b-779c3bbb08d1bdaaa6c6eae6192413d6b71aff21.gz
Diffstat (limited to 'builtin_complete.c')
-rw-r--r-- | builtin_complete.c | 68 |
1 files changed, 41 insertions, 27 deletions
diff --git a/builtin_complete.c b/builtin_complete.c index 90682e21..005dab66 100644 --- a/builtin_complete.c +++ b/builtin_complete.c @@ -39,43 +39,57 @@ static void builtin_complete_add2( const wchar_t *cmd, for( s=short_opt; *s; s++ ) { complete_add( cmd, - cmd_type, - *s, - 0, - 0, - result_mode, - authorative, - condition, - comp, - desc ); + cmd_type, + *s, + 0, + 0, + result_mode, + authorative, + condition, + comp, + desc ); } for( i=0; i<al_get_count( gnu_opt ); i++ ) { complete_add( cmd, - cmd_type, - 0, - (wchar_t *)al_get(gnu_opt, i ), - 0, - result_mode, - authorative, - condition, - comp, - desc ); + cmd_type, + 0, + (wchar_t *)al_get(gnu_opt, i ), + 0, + result_mode, + authorative, + condition, + comp, + desc ); } for( i=0; i<al_get_count( old_opt ); i++ ) { complete_add( cmd, - cmd_type, - 0, - (wchar_t *)al_get(old_opt, i ), - 1, - result_mode, - authorative, - condition, - comp, - desc ); + cmd_type, + 0, + (wchar_t *)al_get(old_opt, i ), + 1, + result_mode, + authorative, + condition, + comp, + desc ); + } + + if( al_get_count( old_opt )+al_get_count( gnu_opt )+wcslen(short_opt) == 0 ) + { + complete_add( cmd, + cmd_type, + 0, + 0, + 0, + result_mode, + authorative, + condition, + comp, + desc ); } } |