From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by melb.werple.net.au (8.7.5/8.7.3/2) with ESMTP id XAA09553 for ; Thu, 4 Jul 1996 23:54:31 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id JAA22922; Thu, 4 Jul 1996 09:44:47 -0400 (EDT) Resent-Date: Thu, 4 Jul 1996 09:44:47 -0400 (EDT) Message-Id: <199607041343.PAA05438@hydra.ifh.de> To: zsh-workers@math.gatech.edu (Zsh hackers list) Subject: Re: Bug in zsh-2.6-beta21 In-reply-to: "pws@ifh.de"'s message of "Mon, 01 Jul 1996 10:22:22 MET." <199607010822.KAA28291@hydra.ifh.de> Date: Thu, 04 Jul 1996 15:43:54 +0200 From: Peter Stephenson Resent-Message-ID: <"5zFYY.0.4c5.Ehysn"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/1526 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu I wrote: > alainc@nortel.ca wrote: > > exec <3 <(ls -l) > > > > ---> zsh: no such file or directory: 3 > > > > So far so good, but after that it seems that zle is broken as the up > > arrow does not retrieve the last command entered. > > 1) Do we delay entersubsh() until after the redirections are handled? Here's a patch for this. It's fairly simple, so I don't see any problems with it. *** Src/exec.c.subsh Thu Jul 4 15:30:39 1996 --- Src/exec.c Thu Jul 4 15:39:05 1996 *************** *** 1102,1108 **** int save[10]; int fil, dfil, is_cursh, type, i; int nullexec = 0, assign = 0, forked = 0; ! int is_shfunc = 0, is_builtin = 0; /* Various flags to the command. */ int cflags = 0, checked = 0; --- 1102,1108 ---- int save[10]; int fil, dfil, is_cursh, type, i; int nullexec = 0, assign = 0, forked = 0; ! int is_shfunc = 0, is_builtin = 0, is_exec = 0; /* Various flags to the command. */ int cflags = 0, checked = 0; *************** *** 1420,1426 **** /* This is an exec (real or fake) for an external command. * * Note that any form of exec means that the subshell is fake * * (but we may be in a subshell already). */ ! entersubsh(how, 1, 1); } if (!(cflags & BINF_NOGLOB)) --- 1420,1426 ---- /* This is an exec (real or fake) for an external command. * * Note that any form of exec means that the subshell is fake * * (but we may be in a subshell already). */ ! is_exec = 1; } if (!(cflags & BINF_NOGLOB)) *************** *** 1551,1556 **** --- 1551,1563 ---- } if (unset(NOEXEC)) { + /* + * We delay the entersubsh() to here when we are exec'ing + * the current shell (including a fake exec to run a builtin then + * exit) in case there is an error return. + */ + if (is_exec) + entersubsh(how, 1, 1); if (type >= CURSH) { static int (*func[]) _((Cmd)) = { -- Peter Stephenson Tel: +49 33762 77366 WWW: http://www.ifh.de/~pws/ Fax: +49 33762 77330 Deutches Electronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen DESY-IfH, 15735 Zeuthen, Germany.