zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@ifh.de>
To: zsh-workers@math.gatech.edu
Subject: Re: seg fault on $(dgqhghdqwdhqwjq) : beta19
Date: Mon, 27 May 1996 19:02:19 +0200	[thread overview]
Message-ID: <199605271702.TAA01865@hydra.ifh.de> (raw)
In-Reply-To: "hzoli@cs.elte.hu"'s message of "Mon, 27 May 1996 03:13:45 MET." <199605270113.DAA01134@hzoli.ppp.cs.elte.hu>

hzoli@cs.elte.hu wrote:
> > res1% $(wekdwqw)
> > zsh: command not found: wekdwqw
> > zsh: 21441 segmentation fault  $(wekdwqw)
> 
> It always happens when prefork() in execcmd() removes all arguments.

It's not quite that simple: prefork turns the first argument into an
empty string, so the argument list isn't quite null and negotiates all
the tests for nonempty(args).  However, fixcline() then comes along
and unhooks the empty argument, leaving an empty list.  This is when
the trouble starts.  Maybe the substitution code needs to be smarter
and unhook its own null arguments, then we can handle empty lines
more consistently in execcmd().  I suppose this goes in prefork().

By the way, it's handled OK with double quotes present:

% zsh -fc '"$(doallmyworkforme)"'
zsh: command not found: doallmyworkforme
zsh: permission denied: 

since there's no command matching the null string.  If that's
acceptable when the quotes are missing (behaviour of other shells
suggests it isn't), a simpler solution is to adapt fixcline() to leave
an empty string if its the only thing left on the line.

Could we simply call fixcline() after or even in prefork(), leaving the
way open for sensible tests in execcmd()?

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



      parent reply	other threads:[~1996-05-27 17:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-05-24 21:06 Anthony Heading
1996-05-25  0:58 ` Hrvoje Niksic
1996-05-27  1:13 ` Zoltan Hidvegi
1996-05-27  2:38   ` Thorsten Meinecke
1996-05-27 13:09     ` Zefram
1996-05-27 16:23       ` Thorsten Meinecke
1996-05-27 17:05         ` Zefram
1996-05-27  4:29   ` Richard Coleman
1996-05-27 17:02   ` Peter Stephenson [this message]

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=199605271702.TAA01865@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).