From e6f14352d61721db83b46e0e56c4d19b731fed95 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Mon, 14 Jun 2010 11:57:08 +0000 Subject: 28037: improved error messages for module autoloads of math functions and builtins --- Src/exec.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Src/exec.c') diff --git a/Src/exec.c b/Src/exec.c index 8fd52420b..6611e9c79 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -2274,18 +2274,20 @@ static HashNode resolvebuiltin(const char *cmdarg, HashNode hn) { if (!((Builtin) hn)->handlerfunc) { + char *modname = dupstring(((Builtin) hn)->optstr); /* * Ensure the module is loaded and the * feature corresponding to the builtin * is enabled. */ - (void)ensurefeature(((Builtin) hn)->optstr, "b:", + (void)ensurefeature(modname, "b:", (hn->flags & BINF_AUTOALL) ? NULL : hn->nam); hn = builtintab->getnode(builtintab, cmdarg); if (!hn) { lastval = 1; - zerr("unknown builtin: %s", cmdarg); + zerr("autoloading module %s failed to define builtin: %s", + modname, cmdarg); return NULL; } } -- cgit v1.2.3