From: Peter Stephenson <pws@pwstephenson.fsnet.co.uk>
To: zsh-workers@sunsite.auc.dk (Zsh hackers list)
Subject: PATCH: 4.1.0: `builtin' with disabled builtin.
Date: Sat, 16 Jun 2001 00:06:08 +0100 [thread overview]
Message-ID: <20010615230613.D5F131428B@pwstephenson.fsnet.co.uk> (raw)
It used to be possible to get round the fact that a builtin was disabled by
putting `builtin' in front of it, which somehow disappeared when I wasn't
looking. I think the old behaviour is useful and harmless. This is based
on my assumption that `disable' is to stop a builtin polluting the general
namespace, not to stop anyone executing it who needs it. Does anyone
have any worries about this?
Index: Doc/Zsh/builtins.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/builtins.yo,v
retrieving revision 1.30
diff -u -r1.30 builtins.yo
--- Doc/Zsh/builtins.yo 2001/06/14 09:49:02 1.30
+++ Doc/Zsh/builtins.yo 2001/06/15 22:01:17
@@ -130,7 +130,8 @@
)
findex(builtin)
item(tt(builtin) var(name) [ var(args) ... ])(
-Executes the builtin var(name), with the given var(args).
+Executes the builtin var(name), with the given var(args). This can
+be used even if var(name) has been disabled.
)
alias(bye)(exit)
module(cap)(zsh/cap)
Index: Src/exec.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/exec.c,v
retrieving revision 1.28
diff -u -r1.28 exec.c
--- Src/exec.c 2001/05/28 09:00:22 1.28
+++ Src/exec.c 2001/06/15 22:01:36
@@ -1714,7 +1714,9 @@
is_shfunc = 1;
break;
}
- if (!(hn = builtintab->getnode(builtintab, cmdarg))) {
+ if (!(hn = (cflags & BINF_BUILTIN) ?
+ builtintab->getnode2(builtintab, cmdarg) :
+ builtintab->getnode(builtintab, cmdarg))) {
checked = !(cflags & BINF_BUILTIN);
break;
}
@@ -1829,7 +1831,9 @@
is_shfunc = 1;
break;
}
- if (!(hn = builtintab->getnode(builtintab, cmdarg))) {
+ if (!(hn = (cflags & BINF_BUILTIN) ?
+ builtintab->getnode2(builtintab, cmdarg) :
+ builtintab->getnode(builtintab, cmdarg))) {
if (cflags & BINF_BUILTIN) {
zwarn("no such builtin: %s", cmdarg, 0);
lastval = 1;
--
Peter Stephenson <pws@pwstephenson.fsnet.co.uk>
Work: pws@csr.com
Web: http://www.pwstephenson.fsnet.co.uk
next reply other threads:[~2001-06-15 22:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-06-15 23:06 Peter Stephenson [this message]
2001-06-16 4:35 ` Bart Schaefer
2001-06-20 10:21 ` Oliver Kiddle
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20010615230613.D5F131428B@pwstephenson.fsnet.co.uk \
--to=pws@pwstephenson.fsnet.co.uk \
--cc=zsh-workers@sunsite.auc.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).