zsh-workers
 help / color / mirror / code / Atom feed
* beta21; Bug in execcmd() and job text question
@ 1996-06-26 23:25 Thorsten Meinecke
       [not found] ` <kaefer@aglaia.snafu.DE>
  0 siblings, 1 reply; 3+ messages in thread
From: Thorsten Meinecke @ 1996-06-26 23:25 UTC (permalink / raw)
  To: zsh-workers

1) Whoa!

  % ls =()
  zsh: parse error in process substitution
  zsh: segmentation fault  ../../zsh-RCS-b21/Src/zsh -f

This happens in getjobtext(), after the argument of the command was
nuked in prefork().

2) I can see why getjobtext() was moved behind prefork() by the recent
reconstruction in this area.  But why can't the original, that is unsub-
stituted job text be kept when the command was a simple command?  For
example, no problem with this...

 % setopt shwordsplit; foo="sleep 10"
 % $foo& jobs
 [1] 850
 [1]  + running    sleep 10

...but wouldn't it be better to say `eval $foo' in the example below?

 % eval $foo& jobs
 [1] 884
 [1]  + running    eval sleep 10

Unless I'm missing something obvious, the patch below might fix both.
Regards,
--Thorsten


*** exec.c	1996/06/25 07:34:03	2.37
--- exec.c	1996/06/26 22:00:14
***************
*** 1165,1170 ****
--- 1165,1176 ----
  	}
      }
  
+     /* Get the text associated with this command. */
+     if (jobbing || (how & Z_TIMED))
+ 	text = getjobtext((void *) cmd);
+     else
+ 	text = NULL;
+ 
      /* Do prefork substitutions */
      prefork(args, (((type == CCASE) ? 4 : 0)
  		   | (assign ? 2 : isset(MAGICEQUALSUBST))));
***************
*** 1252,1262 ****
  	}
      }
  
!     /* Get the text associated with this command. */
!     if (jobbing || (how & Z_TIMED))
  	text = getjobtext((void *) cmd);
-     else
- 	text = NULL;
  
      /* Set up special parameter $_ */
      zsfree(underscore);
--- 1258,1266 ----
  	}
      }
  
!     /* Update the text for this command if it was not a simple one. */
!     if (!errflag && !checked && (jobbing || (how & Z_TIMED)))
  	text = getjobtext((void *) cmd);
  
      /* Set up special parameter $_ */
      zsfree(underscore);



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1996-06-27  0:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-06-26 23:25 beta21; Bug in execcmd() and job text question Thorsten Meinecke
     [not found] ` <kaefer@aglaia.snafu.DE>
1996-06-27  0:37   ` Bart Schaefer
1996-06-27  0:46     ` Zefram

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).