about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-11-03 10:48:39 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-11-03 10:48:39 +0000
commit4777e2acd41ad06d172ff06e2ff989fdeee3e19b (patch)
tree53c0ec7aab30f9e1ad6cf618be54f0223e608c00 /Src
parent438a49c8d7a105b5e0b24eb3f658cad14df841c4 (diff)
downloadzsh-4777e2acd41ad06d172ff06e2ff989fdeee3e19b.tar.gz
zsh-4777e2acd41ad06d172ff06e2ff989fdeee3e19b.tar.xz
zsh-4777e2acd41ad06d172ff06e2ff989fdeee3e19b.zip
zsh-workers/8515
Diffstat (limited to 'Src')
-rw-r--r--Src/Zle/comp.h2
-rw-r--r--Src/Zle/compctl.h2
-rw-r--r--Src/builtin.c2
-rw-r--r--Src/module.c16
4 files changed, 14 insertions, 8 deletions
diff --git a/Src/Zle/comp.h b/Src/Zle/comp.h
index 6097f256c..59701608e 100644
--- a/Src/Zle/comp.h
+++ b/Src/Zle/comp.h
@@ -1,5 +1,5 @@
 /*
- * complete.h - header file for completion
+ * comp.h - header file for completion
  *
  * This file is part of zsh, the Z shell.
  *
diff --git a/Src/Zle/compctl.h b/Src/Zle/compctl.h
index 9a8ba5692..4dbc4862e 100644
--- a/Src/Zle/compctl.h
+++ b/Src/Zle/compctl.h
@@ -1,5 +1,5 @@
 /*
- * comp.h - header file for completion
+ * compctl.h - header file for completion
  *
  * This file is part of zsh, the Z shell.
  *
diff --git a/Src/builtin.c b/Src/builtin.c
index 3df653dcc..6f9b1dd57 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -127,7 +127,7 @@ static struct builtin builtins[] =
 #ifdef DYNAMIC
     BUILTIN("zmodload", 0, bin_zmodload, 0, -1, 0, "ILabcfdipue", NULL),
 #else
-    BUILTIN("zmodload", 0, bin_zmodload, 0, -1, 0, "e", NULL),
+    BUILTIN("zmodload", 0, bin_zmodload, 0, -1, 0, "ei", NULL),
 #endif
 };
 
diff --git a/Src/module.c b/Src/module.c
index e620073ce..9be11f195 100644
--- a/Src/module.c
+++ b/Src/module.c
@@ -1251,9 +1251,9 @@ bin_zmodload_load(char *nam, char **args, char *ops)
 int
 bin_zmodload(char *nam, char **args, char *ops, int func)
 {
-    /* We understand only the -e option. */
+    /* We understand only the -e option (and ignore -i). */
 
-    if (ops['e']) {
+    if (ops['e'] || *args) {
 	LinkNode node;
 
 	if (!*args) {
@@ -1261,13 +1261,19 @@ bin_zmodload(char *nam, char **args, char *ops, int func)
 		nicezputs((char *) getdata(node), stdout);
 		putchar('\n');
 	    }
-	    return 0;
 	} else {
-	    for (; *args; args++)
+	    for (; *args; args++) {
 		for (node = firstnode(bltinmodules); node; incnode(node))
 		    if (!strcmp(*args, (char *) getdata(node)))
-			return 0;
+			break;
+		if (!node) {
+		    if (!ops['e'])
+			zerrnam(nam, "cannot load module: `%s'", *args, 0);
+		    return 1;
+		}
+	    }
 	}
+	return 0;
     }
     /* Otherwise we return 1 -- different from the dynamic version. */
     return 1;