Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
beta21; Bug in execcmd() and job text question
- X-seq: zsh-workers 1449
- From: Thorsten Meinecke <kaefer@xxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxxx
- Subject: beta21; Bug in execcmd() and job text question
- Date: Thu, 27 Jun 1996 01:25:19 +0200 (MET DST)
- Organization: none. Location: Berlin, Germany
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);
Messages sorted by:
Reverse Date,
Date,
Thread,
Author