diff options
Diffstat (limited to 'wrapper/plugin-find.h')
-rw-r--r-- | wrapper/plugin-find.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/wrapper/plugin-find.h b/wrapper/plugin-find.h index f2d102f..1a5096b 100644 --- a/wrapper/plugin-find.h +++ b/wrapper/plugin-find.h @@ -87,11 +87,17 @@ plugin_find_commands(struct plugin *plugin, char *name) if (plugin==NULL) return NULL; else { - struct plugin_command_list *command; - command=xmalloc( sizeof *command ); - command->command=plugin_find_command(plugin,name); - command->next=plugin_find_commands(plugin->next,name); - return command; + struct plugin_command *command; + command=plugin_find_command(plugin,name); + struct plugin_command_list *node; + if (command==NULL) + node=plugin_find_commands(plugin->next,name); + else { + node=xmalloc( sizeof *node ); + node->command=command; + node->next=plugin_find_commands(plugin->next,name); + } + return node; } } |