From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7673 invoked from network); 15 Jun 2001 22:04:56 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 15 Jun 2001 22:04:56 -0000 Received: (qmail 12795 invoked by alias); 15 Jun 2001 22:04:25 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14938 Received: (qmail 12783 invoked from network); 15 Jun 2001 22:04:25 -0000 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 From: Peter Stephenson Message-Id: <20010615230613.D5F131428B@pwstephenson.fsnet.co.uk> 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 Work: pws@csr.com Web: http://www.pwstephenson.fsnet.co.uk