diff options
author | Bart Schaefer <barts@users.sourceforge.net> | 2000-08-15 16:53:08 +0000 |
---|---|---|
committer | Bart Schaefer <barts@users.sourceforge.net> | 2000-08-15 16:53:08 +0000 |
commit | 934dd1c694f8b9f8569e375327aeddd8c321f284 (patch) | |
tree | e67531aa735df654a1bd0e4b9eddd62a5deb1615 /Src/module.c | |
parent | 0352b80797d54dbfdd6f7f27e24980b0d8c0b666 (diff) | |
download | zsh-934dd1c694f8b9f8569e375327aeddd8c321f284.tar.gz zsh-934dd1c694f8b9f8569e375327aeddd8c321f284.tar.xz zsh-934dd1c694f8b9f8569e375327aeddd8c321f284.zip |
12652: Variable scoping problem.
Diffstat (limited to 'Src/module.c')
-rw-r--r-- | Src/module.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/Src/module.c b/Src/module.c index bac8f5c42..13b747f05 100644 --- a/Src/module.c +++ b/Src/module.c @@ -1142,23 +1142,24 @@ bin_zmodload_dep(char *nam, char **args, char *ops) { LinkNode node; Module m; - if(ops['u']) { + if (ops['u']) { /* remove dependencies, which can't pertain to aliases */ const char *tnam = *args++; node = find_module(tnam, 1, &tnam); if (!node) return 0; m = (Module) getdata(node); - if(*args && m->deps) { + if (*args && m->deps) { do { - for(node = firstnode(m->deps); node; incnode(node)) - if(!strcmp(*args, getdata(node))) { - zsfree(getdata(node)); - remnode(m->deps, node); + LinkNode dnode; + for (dnode = firstnode(m->deps); dnode; incnode(dnode)) + if (!strcmp(*args, getdata(dnode))) { + zsfree(getdata(dnode)); + remnode(m->deps, dnode); break; } } while(*++args); - if(empty(m->deps)) { + if (empty(m->deps)) { freelinklist(m->deps, freestr); m->deps = NULL; } @@ -1171,13 +1172,13 @@ bin_zmodload_dep(char *nam, char **args, char *ops) if (!m->deps && !m->u.handle) delete_module(node); return 0; - } else if(!args[0] || !args[1]) { + } else if (!args[0] || !args[1]) { /* list dependencies */ for (node = firstnode(modules); node; incnode(node)) { m = (Module) getdata(node); if (m->deps && (!args[0] || !strcmp(args[0], m->nam))) { LinkNode n; - if(ops['L']) { + if (ops['L']) { printf("zmodload -d "); if(m->nam[0] == '-') fputs("-- ", stdout); @@ -1202,7 +1203,7 @@ bin_zmodload_dep(char *nam, char **args, char *ops) int ret = 0; char *tnam = *args++; - for(; *args; args++) + for (; *args; args++) add_dep(tnam, *args); return ret; } |