summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--Doc/Zsh/mod_parameter.yo5
-rw-r--r--Src/Modules/parameter.c8
3 files changed, 11 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 4a3931af8..82d8961bb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2000-08-16 Sven Wischnowsky <wischnow@zsh.org>
+ * 12654: Doc/Zsh/mod_parameter.yo, Src/Modules/parameter.c: make
+ $modules report aliases correctly
+
* unposted: Completion/Builtins/_pids: remove unnecessary local parameter
2000-08-15 Peter Stephenson <pws@csr.com>
diff --git a/Doc/Zsh/mod_parameter.yo b/Doc/Zsh/mod_parameter.yo
index ef8eed07a..dc611258e 100644
--- a/Doc/Zsh/mod_parameter.yo
+++ b/Doc/Zsh/mod_parameter.yo
@@ -91,9 +91,10 @@ Setting or unsetting keys in this array is not possible.
vindex(modules)
item(tt(modules))(
An associative array giving information about modules. The keys are the names
-of the modules builtin, loaded, or registered to be autoloaded. The
+of the modules loaded, registered to be autoloaded, or aliased. The
value says which state the named module is in and is one of the
-strings tt(builtin), tt(loaded), or tt(autoloaded).
+strings `tt(loaded)', `tt(autoloaded)', or `tt(alias:)var(name)',
+where var(name) is the name the module is aliased to.
Setting or unsetting keys in this array is not possible.
)
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);
}