about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rw-r--r--Src/builtin.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index b65de3925..a73ab744c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2019-07-08  Bart Schaefer  <schaefer@brasslantern.com>
 
+	* 44502: Src/builtin.c: Quote function name for "autoload -X"
+
 	* 44495: Doc/Zsh/params.yo: Mention coproc under $!
 
 2019-07-08  Peter Stephenson  <p.stephenson@samsung.com>
diff --git a/Src/builtin.c b/Src/builtin.c
index 9b9e76c77..7db36c41b 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -3029,7 +3029,7 @@ eval_autoload(Shfunc shf, char *name, Options ops, int func)
     }
     if (OPT_MINUS(ops,'X')) {
 	char *fargv[3];
-	fargv[0] = name;
+	fargv[0] = quotestring(name, QT_SINGLE_OPTIONAL);
 	fargv[1] = "\"$@\"";
 	fargv[2] = 0;
 	shf->funcdef = mkautofn(shf);