1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

Don't crash if there's no prefixes (botti doesn't) when loading module.

Patch by aldem-irssi@aldem.net


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2607 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2002-03-14 01:54:05 +00:00 committed by cras
parent 7d88170b0b
commit 265ecbc74d

View File

@ -64,14 +64,17 @@ static char *module_get_root(const char *name, char **prefixes)
int len; int len;
/* skip any of the prefixes.. */ /* skip any of the prefixes.. */
if (prefixes != NULL) {
while (*prefixes != NULL) { while (*prefixes != NULL) {
len = strlen(*prefixes); len = strlen(*prefixes);
if (strncmp(name, *prefixes, len) == 0 && name[len] == '_') { if (strncmp(name, *prefixes, len) == 0 &&
name[len] == '_') {
name += len+1; name += len+1;
break; break;
} }
prefixes++; prefixes++;
} }
}
/* skip the _core part */ /* skip the _core part */
len = strlen(name); len = strlen(name);