zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@ifh.de>
To: zsh-workers@math.gatech.edu (Zsh hackers list)
Subject: Re: Bug in zsh-2.6-beta21
Date: Thu, 04 Jul 1996 15:43:54 +0200	[thread overview]
Message-ID: <199607041343.PAA05438@hydra.ifh.de> (raw)
In-Reply-To: "pws@ifh.de"'s message of "Mon, 01 Jul 1996 10:22:22 MET." <199607010822.KAA28291@hydra.ifh.de>

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 <pws@ifh.de>       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.



  reply	other threads:[~1996-07-04 13:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-06-21 14:29 alain (a.) caron
1996-07-01  8:22 ` Peter Stephenson
1996-07-04 13:43   ` Peter Stephenson [this message]
     [not found] <199606251855.UAA03602@woodstock.ens-lyon.fr>
1996-06-25 19:15 ` bug " Hrvoje Niksic

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=199607041343.PAA05438@hydra.ifh.de \
    --to=pws@ifh.de \
    --cc=zsh-workers@math.gatech.edu \
    /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).