Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: improvement in builtin addition/deletion
- X-seq: zsh-workers 2650
- From: Zoltan Hidvegi <hzoli@xxxxxxxxxx>
- To: zefram@xxxxxxxxxxxxxxxxx (Zefram)
- Subject: Re: improvement in builtin addition/deletion
- Date: Sat, 28 Dec 1996 01:06:09 +0100 (MET)
- In-reply-to: <6676.199612271120@xxxxxxxxxxxxxxxxxxxxxxx> from Zefram at "Dec 27, 96 11:19:59 am"
- Sender: hzoli@xxxxxxxxxx
Zefram wrote:
> This patch adds two new functions, addbuiltins() and deletebuiltins().
> They add and delete several builtins at once, in the manner of the code
> I produced for the files module. They are actually helpful even when
> adding only one builtin: they ensure that error messages are correctly
> generated in all cases. It also makes adding a second builtin to the
> module as easy as possible.
There is a little bug in that patch, fix is below.
Zoltan
*** Src/module.c.zefram Sat Dec 28 00:59:10 1996
--- Src/module.c Sat Dec 28 01:00:03 1996
***************
*** 92,101 ****
if(addbuiltin(b->nam, b->binf, b->func,
b->minargs, b->maxargs, b->funcid, b->optstr, b->defopts)) {
zwarnnam(nam, "name clash when adding builtin `%s'", b->nam, 0);
- b->flags |= BINL_ADDED;
hadf = 1;
! } else
hads = 2;
}
return hadf ? hads : 1;
}
--- 92,102 ----
if(addbuiltin(b->nam, b->binf, b->func,
b->minargs, b->maxargs, b->funcid, b->optstr, b->defopts)) {
zwarnnam(nam, "name clash when adding builtin `%s'", b->nam, 0);
hadf = 1;
! } else {
! b->flags |= BINL_ADDED;
hads = 2;
+ }
}
return hadf ? hads : 1;
}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author