about summary refs log tree commit diff
path: root/Src/exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/exec.c')
-rw-r--r--Src/exec.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/Src/exec.c b/Src/exec.c
index 751282127..ccba66bf8 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -2012,7 +2012,12 @@ execcmd(Estate state, int input, int output, int how, int last1)
 
 		/* autoload the builtin if necessary */
 		if (!((Builtin) hn)->handlerfunc) {
-		    (void)load_module(((Builtin) hn)->optstr, NULL);
+		    /*
+		     * Ensure the module is loaded and the
+		     * feature corresponding to the builtin
+		     * is enabled.
+		     */
+		    (void)ensurefeature(((Builtin) hn)->optstr, "b:", hn->nam);
 		    hn = builtintab->getnode(builtintab, cmdarg);
 		}
 		assign = (hn && (hn->flags & BINF_MAGICEQUALS));
@@ -2229,7 +2234,7 @@ execcmd(Estate state, int input, int output, int how, int last1)
 
 		/* autoload the builtin if necessary */
 		if (!((Builtin) hn)->handlerfunc) {
-		    (void)load_module(((Builtin) hn)->optstr, NULL);
+		    (void)ensurefeature(((Builtin) hn)->optstr, "b:", cmdarg);
 		    hn = builtintab->getnode(builtintab, cmdarg);
 		}
 		break;