From 1b52f47cf285d5f3835bce7ad73f360bd327d4e8 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Fri, 6 Jul 2007 21:52:38 +0000 Subject: 23665: autoloading of module features and related tweaks --- Src/params.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'Src/params.c') diff --git a/Src/params.c b/Src/params.c index 5609437a2..46da87580 100644 --- a/Src/params.c +++ b/Src/params.c @@ -411,7 +411,7 @@ newparamtable(int size, char const *name) /**/ static HashNode -getparamnode(HashTable ht, char *nam) +getparamnode(HashTable ht, const char *nam) { HashNode hn = gethashnode2(ht, nam); Param pm = (Param) hn; @@ -419,12 +419,16 @@ getparamnode(HashTable ht, char *nam) if (pm && pm->u.str && (pm->node.flags & PM_AUTOLOAD)) { char *mn = dupstring(pm->u.str); - if (ensurefeature(mn, "p:", nam)) - return NULL; + (void)ensurefeature(mn, "p:", (pm->node.flags & PM_AUTOALL) ? NULL : + nam); hn = gethashnode2(ht, nam); - if (((Param) hn) == pm && (pm->node.flags & PM_AUTOLOAD)) { - pm->node.flags &= ~PM_AUTOLOAD; - zwarnnam(nam, "autoload failed"); + if (!hn) { + /* + * This used to be a warning, but surely if we allow + * stuff to go ahead with the autoload stub with + * no error status we're in for all sorts of mayhem? + */ + zerr("unknown parameter: %s", nam); } } return hn; -- cgit 1.4.1