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,13 +64,16 @@ static char *module_get_root(const char *name, char **prefixes)
int len; int len;
/* skip any of the prefixes.. */ /* skip any of the prefixes.. */
while (*prefixes != NULL) { if (prefixes != NULL) {
len = strlen(*prefixes); while (*prefixes != NULL) {
if (strncmp(name, *prefixes, len) == 0 && name[len] == '_') { len = strlen(*prefixes);
name += len+1; if (strncmp(name, *prefixes, len) == 0 &&
break; name[len] == '_') {
name += len+1;
break;
}
prefixes++;
} }
prefixes++;
} }
/* skip the _core part */ /* skip the _core part */