Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: Re: Seg fault with zmodload -u
- X-seq: zsh-workers 12652
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxxxxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxxxxxxxxx>
- Subject: PATCH: Re: Seg fault with zmodload -u
- Date: Tue, 15 Aug 2000 16:46:59 +0000
- In-reply-to: <20000815175602.A25814@xxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
- References: <200008151518.QAA42116@xxxxxxxx> <20000815174053.B5810@xxxxxxxxxxxxxxxxx> <20000815174856.A20116@xxxxxxxxxxxxxxxxx> <20000815175602.A25814@xxxxxxxxxxxxxxxxx>
Unintentional re-use of a local variable name.
And stuff in some horizontal whitespace, as long as I'm here.
Index: Src/module.c
===================================================================
RCS file: /extra/cvsroot/zsh/zsh-3.1/Src/module.c,v
retrieving revision 1.36
diff -u -r1.36 module.c
--- module.c 2000/08/08 15:24:41 1.36
+++ module.c 2000/08/15 16:45:44
@@ -1142,23 +1142,24 @@
{
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 @@
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 @@
int ret = 0;
char *tnam = *args++;
- for(; *args; args++)
+ for (; *args; args++)
add_dep(tnam, *args);
return ret;
}
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
Messages sorted by:
Reverse Date,
Date,
Thread,
Author