Bail out of check_auto_reply() early if auto_str is NULL. This fixes a
crash after /SETAR -. Reported by riderplus. git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@234 13b04d17-f746-0410-82c6-800466cd88b0
This commit is contained in:
@@ -134,37 +134,37 @@ void fake (void)
|
||||
|
||||
int check_auto_reply(char *str)
|
||||
{
|
||||
char *p = NULL;
|
||||
char *pat;
|
||||
if (!str || !*str || !get_int_var(AUTO_RESPONSE_VAR))
|
||||
char *p = NULL;
|
||||
char *pat;
|
||||
|
||||
if (!str || !*str || !get_int_var(AUTO_RESPONSE_VAR) || !auto_str)
|
||||
return 0;
|
||||
|
||||
p = LOCAL_COPY(auto_str);
|
||||
if (p && *p)
|
||||
while ((pat = next_arg(p, &p)))
|
||||
{
|
||||
while ((pat = next_arg(p, &p)))
|
||||
switch(get_int_var(NICK_COMPLETION_TYPE_VAR))
|
||||
{
|
||||
switch(get_int_var(NICK_COMPLETION_TYPE_VAR))
|
||||
{
|
||||
case 3:
|
||||
if (!my_stricmp(str, pat))
|
||||
goto found_auto;
|
||||
continue;
|
||||
case 2:
|
||||
if (wild_match(pat, str))
|
||||
goto found_auto;
|
||||
continue;
|
||||
case 1:
|
||||
if (stristr(str, pat))
|
||||
goto found_auto;
|
||||
continue;
|
||||
default:
|
||||
case 0:
|
||||
if (!my_strnicmp(str, pat, strlen(pat)))
|
||||
goto found_auto;
|
||||
continue;
|
||||
}
|
||||
case 3:
|
||||
if (!my_stricmp(str, pat))
|
||||
goto found_auto;
|
||||
continue;
|
||||
case 2:
|
||||
if (wild_match(pat, str))
|
||||
goto found_auto;
|
||||
continue;
|
||||
case 1:
|
||||
if (stristr(str, pat))
|
||||
goto found_auto;
|
||||
continue;
|
||||
default:
|
||||
case 0:
|
||||
if (!my_strnicmp(str, pat, strlen(pat)))
|
||||
goto found_auto;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
found_auto:
|
||||
#ifdef GUI
|
||||
|
||||
Reference in New Issue
Block a user