aboutsummaryrefslogtreecommitdiffhomepage
path: root/complete.c
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2006-10-19 01:51:51 +1000
committerGravatar axel <axel@liljencrantz.se>2006-10-19 01:51:51 +1000
commit2ab04f40437537a96bb11fcbe7ffd0ed3ee8e8d7 (patch)
tree0c0bfa98b3ed66c636993b1440fc4b3c78cf3444 /complete.c
parentb32bbb24b9b5e1a14c3f7186a2ea04aeffc1b64c (diff)
Skip command description lookup when no commands where found
darcs-hash:20061018155151-ac50b-5562479da23b89571f91ae1e2ed15e640ef0a094.gz
Diffstat (limited to 'complete.c')
-rw-r--r--complete.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/complete.c b/complete.c
index 680af799..f332c2bd 100644
--- a/complete.c
+++ b/complete.c
@@ -1271,9 +1271,11 @@ static void complete_cmd( const wchar_t *cmd,
wchar_t *cdpath = env_get(L"CDPATH");
wchar_t *cdpath_cpy = wcsdup( cdpath?cdpath:L"." );
+ int prev_count = al_get_count( comp );
if( (wcschr( cmd, L'/') != 0) || (cmd[0] == L'~' ) )
{
+
array_list_t tmp;
al_init( &tmp );
@@ -1282,7 +1284,10 @@ static void complete_cmd( const wchar_t *cmd,
comp,
ACCEPT_INCOMPLETE | EXECUTABLES_ONLY ) != EXPAND_ERROR )
{
- complete_cmd_desc( cmd, comp );
+ if( al_get_count( comp ) > prev_count )
+ {
+ complete_cmd_desc( cmd, comp );
+ }
}
al_destroy( &tmp );
}
@@ -1324,7 +1329,10 @@ static void complete_cmd( const wchar_t *cmd,
}
free( path_cpy );
- complete_cmd_desc( cmd, comp );
+ if( al_get_count( comp ) > prev_count )
+ {
+ complete_cmd_desc( cmd, comp );
+ }
}
/*
@@ -1575,6 +1583,7 @@ static void complete_load_handler( const wchar_t *cmd )
void complete_load( const wchar_t *name, int reload )
{
+ CHECK( name, );
parse_util_load( name,
L"fish_complete_path",
&complete_load_handler,
@@ -2186,6 +2195,8 @@ void complete_print( string_buffer_t *out )
{
complete_entry *e;
+ CHECK( out, );
+
for( e = first_entry; e; e=e->next )
{
complete_entry_opt *o;