diff options
Diffstat (limited to 'Src/Modules')
| -rw-r--r-- | Src/Modules/parameter.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/Src/Modules/parameter.c b/Src/Modules/parameter.c index 6d1f74d22..2bcfe81a3 100644 --- a/Src/Modules/parameter.c +++ b/Src/Modules/parameter.c @@ -217,10 +217,20 @@ getpmcommand(UNUSED(HashTable ht), const char *name) Cmdnam cmd; Param pm = NULL; - if (!(cmd = (Cmdnam) cmdnamtab->getnode(cmdnamtab, name)) && - isset(HASHLISTALL)) { - cmdnamtab->filltable(cmdnamtab); - cmd = (Cmdnam) cmdnamtab->getnode(cmdnamtab, name); + if (!(cmd = (Cmdnam) cmdnamtab->getnode(cmdnamtab, name))) { + if (isset(HASHLISTALL)) { + cmdnamtab->filltable(cmdnamtab); + cmd = (Cmdnam) cmdnamtab->getnode(cmdnamtab, name); + } else { + /* this will return the path even if hashcmds is disabled, + * and store it in the hash if it is enabled */ + char *found = findcmd((char*)name, 1, 0); + if (found) { + cmd = (Cmdnam) hcalloc(sizeof(*cmd)); + cmd->u.cmd = found; + cmd->node.flags = HASHED; + } + } } pm = (Param) hcalloc(sizeof(struct param)); pm->node.nam = dupstring(name); |
