From 1883e2c0c3d1bf35f20092f04835e009dbaa302a Mon Sep 17 00:00:00 2001 From: Kevin Easton Date: Fri, 12 Jun 2015 16:57:19 +1000 Subject: [PATCH] Minor fix to /STACK to make it match /SET behaviour Previously /STACK would not accept just the initial part of a /SET name even if it wasn't ambiguous. Now it uses the same matching behaviour as /SET. This also removes an unused variable in do_stack_set(). --- source/vars.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/vars.c b/source/vars.c index 1ef84e0..ea32975 100644 --- a/source/vars.c +++ b/source/vars.c @@ -1006,7 +1006,7 @@ void do_stack_set(int type, char *args) /* Dont need to unstub it, we're not actually using it. */ upper(copy); find_fixed_array_item(irc_variable, sizeof(IrcVariable), NUMBER_OF_VARIABLES, copy, &cnt, (int *)&var_index); - if (cnt < 0) + if (cnt < 0 || cnt == 1) { aptr = (AliasStack1 *)new_malloc(sizeof(AliasStack1)); aptr->next = aptrptr ? *aptrptr : NULL; @@ -1053,8 +1053,7 @@ void do_stack_set(int type, char *args) } if (STACK_LIST == type) { - AliasStack1 *prev = NULL; - for (aptr = *aptrptr; aptr; prev = aptr, aptr = aptr->next) + for (aptr = *aptrptr; aptr; aptr = aptr->next) { switch(aptr->set->type) {