summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2006-10-29 22:00:52 +0000
committerSebastien Helleu <flashcode@flashtux.org>2006-10-29 22:00:52 +0000
commitb3b516e0236ed3d46579faa73391677665e27f9c (patch)
tree166fbd99735096a718c53a6b79b6dbbadee3fe8c /src
parent07dc0c85df742b6e076a1efb3de23aca5b616ace (diff)
downloadweechat-b3b516e0236ed3d46579faa73391677665e27f9c.zip
Fixed bug with completion context (some variables were not properly reset)
Diffstat (limited to 'src')
-rw-r--r--src/common/completion.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/common/completion.c b/src/common/completion.c
index dc4425365..749641f1c 100644
--- a/src/common/completion.c
+++ b/src/common/completion.c
@@ -54,8 +54,10 @@
void
completion_init (t_completion *completion, void *server, void *channel)
{
- completion->server = server;
- completion->channel = channel;
+ if (server)
+ completion->server = server;
+ if (channel)
+ completion->channel = channel;
completion->context = COMPLETION_NULL;
completion->base_command = NULL;
completion->base_command_arg = 0;
@@ -967,7 +969,7 @@ completion_find_context (t_completion *completion, char *buffer, int size, int p
/* look for context */
completion_free (completion);
- completion->add_space = 1;
+ completion_init (completion, NULL, NULL);
command = ((buffer[0] == '/') && (buffer[1] != '/')) ? 1 : 0;
command_arg = 0;
i = 0;