about summary refs log tree commit diff
path: root/Src/Modules/parameter.c
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-08-16 09:25:39 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-08-16 09:25:39 +0000
commit5821e7ef16b868c9300b52c2042845965ed3e874 (patch)
tree12ba76e5fe9d899abe314343a4be63629e0112ee /Src/Modules/parameter.c
parent00eb6e8a25e956bd0dfc3c7e8e7dec266f33ce33 (diff)
downloadzsh-5821e7ef16b868c9300b52c2042845965ed3e874.tar.gz
zsh-5821e7ef16b868c9300b52c2042845965ed3e874.tar.xz
zsh-5821e7ef16b868c9300b52c2042845965ed3e874.zip
make $modules report aliases correctly (12654)
Diffstat (limited to 'Src/Modules/parameter.c')
-rw-r--r--Src/Modules/parameter.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/Src/Modules/parameter.c b/Src/Modules/parameter.c
index e8a0c09a0..924799c0c 100644
--- a/Src/Modules/parameter.c
+++ b/Src/Modules/parameter.c
@@ -892,7 +892,8 @@ getpmmodule(HashTable ht, char *name)
 	    m = (Module) getdata(node);
 	    if (m->u.handle && !(m->flags & MOD_UNLOAD) &&
 		!strcmp(name, m->nam)) {
-		type = "loaded";
+		type = ((m->flags & MOD_ALIAS) ?
+			dyncat("alias:", m->u.alias) : "loaded");
 		break;
 	    }
 	}
@@ -935,6 +936,7 @@ scanpmmodules(HashTable ht, ScanFunc func, int flags)
     LinkNode node;
     Module m;
     Conddef p;
+    char *loaded = dupstring("loaded");
 
     pm.flags = PM_SCALAR | PM_READONLY;
     pm.sets.cfn = NULL;
@@ -946,12 +948,12 @@ scanpmmodules(HashTable ht, ScanFunc func, int flags)
     pm.old = NULL;
     pm.level = 0;
 
-    pm.u.str = dupstring("builtin");
-    pm.u.str = dupstring("loaded");
     for (node = firstnode(modules); node; incnode(node)) {
 	m = (Module) getdata(node);
 	if (m->u.handle && !(m->flags & MOD_UNLOAD)) {
 	    pm.nam = m->nam;
+	    pm.u.str = ((m->flags & MOD_ALIAS) ?
+			dyncat("alias:", m->u.alias) : loaded);
 	    addlinknode(done, pm.nam);
 	    func((HashNode) &pm, flags);
 	}