summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/modules-load.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/core/modules-load.c b/src/core/modules-load.c
index e7e78091..69bdecdf 100644
--- a/src/core/modules-load.c
+++ b/src/core/modules-load.c
@@ -64,13 +64,16 @@ static char *module_get_root(const char *name, char **prefixes)
int len;
/* skip any of the prefixes.. */
- while (*prefixes != NULL) {
- len = strlen(*prefixes);
- if (strncmp(name, *prefixes, len) == 0 && name[len] == '_') {
- name += len+1;
- break;
+ if (prefixes != NULL) {
+ while (*prefixes != NULL) {
+ len = strlen(*prefixes);
+ if (strncmp(name, *prefixes, len) == 0 &&
+ name[len] == '_') {
+ name += len+1;
+ break;
+ }
+ prefixes++;
}
- prefixes++;
}
/* skip the _core part */