zsh-workers
 help / color / mirror / code / Atom feed
* Re: forwarded bug report
@ 1999-05-31 13:12 Sven Wischnowsky
  1999-05-31 13:05 ` Peter Stephenson
  1999-05-31 14:38 ` Tanaka Akira
  0 siblings, 2 replies; 10+ messages in thread
From: Sven Wischnowsky @ 1999-05-31 13:12 UTC (permalink / raw)
  To: zsh-workers


Markus F.X.J. Oberhumer wrote:

> zsh badly hangs if file globbing fails in connection
> with completion. Please try the following with
> any zsh 3.x version (including 3.1.5-pws-19) and
> enter "foo [tab]":
> 
>   compctl -s "\$(cat [tT]his-file-does-not-exist)" foo

When expanding the -s-string, we explicitly switch NULL_GLOB on so
that `compctl -s "*.c \$(< foo)"' works without producing an error if
there is no `*.c'.
Of course, this makes it fail in cases like the one above... (where
the cat tries to start reading and never finishes).

Does anyone have an idea how we could make this safe?

Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: forwarded bug report
@ 1999-06-04  9:54 Sven Wischnowsky
  1999-06-04  9:40 ` Peter Stephenson
  1999-06-04 10:33 ` Bart Schaefer
  0 siblings, 2 replies; 10+ messages in thread
From: Sven Wischnowsky @ 1999-06-04  9:54 UTC (permalink / raw)
  To: zsh-workers


Bart Schaefer wrote:

> On May 31,  3:12pm, Sven Wischnowsky wrote:
> } Subject: Re: forwarded bug report
> } 
> } Markus F.X.J. Oberhumer wrote:
> } >   compctl -s "\$(cat [tT]his-file-does-not-exist)" foo
> } 
> } When expanding the -s-string, we explicitly switch NULL_GLOB on so
> } that `compctl -s "*.c \$(< foo)"' works without producing an error if
> } there is no `*.c'.
> 
> That's not the only reason, is it?  We want the list of completion matches
> to be empty when the glob pattern fails; if the only concern was for the
> error, we could use NO_NOMATCH instead.

That's what I meant (I should have written `no files matching...').

> } Of course, this makes it fail in cases like the one above... (where
> } the cat tries to start reading and never finishes).
> } 
> } Does anyone have an idea how we could make this safe?
> 
> Seems as if we need a variant of NULL_GLOB that actually replaces the
> unmatched patterns with empty strings, rather than deleting them from the
> command entirely.

But that would fail with $(cat *.c *.h) if there are *.h files, but no 
*.c files.

> On May 31, 11:38pm, Tanaka Akira wrote:
> } Subject: Re: forwarded bug report
> }
> } I think that zsh can prevents hanging by redirecting stdin to /dev/null.
> 
> That's probably a good idea, but it doesn't solve the more general problem
> of commands being invoked with a different-than-expected number of args.
> 
> (Providing a closed stdin as if <&- might be a better idea for most cases,
> though it causes "cat" to complain about bad file descriptors.)

It seems that neither of sh, ksh, bash, and tcsh closes/redirects-to-/dev/null 
stdin of $(...) and `...` constructs. Should we do this only only when 
this may be called from completion?

Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 10+ messages in thread
* forwarded bug report
@ 1999-05-31 11:40 Peter Stephenson
  0 siblings, 0 replies; 10+ messages in thread
From: Peter Stephenson @ 1999-05-31 11:40 UTC (permalink / raw)
  To: Zsh hackers list


just got this which I should probably pass on.

------- Forwarded Message

Message-Id: <XFMail.990527044528.markus.oberhumer@jk.uni-linz.ac.at>
Content-Type: text/plain; charset=iso-8859-1
Mime-Version: 1.0
Date: Thu, 27 May 1999 04:45:28 +0200 (CEST)
Reply-To: markus.oberhumer@jk.uni-linz.ac.at
From: "Markus F.X.J. Oberhumer" <markus.oberhumer@jk.uni-linz.ac.at>
To: pws@ifh.de
Subject: zsh 3.1.5-pws-19 bug report
Content-Transfer-Encoding: 8bit

Hello Peter !

It's good to see that someone is still working on inproving
zsh. I'm using this opportunity to report a nasty bug
that is annoying me for almost two years now (I had posted
that to zsh-workers a year ago, but without response).

zsh badly hangs if file globbing fails in connection
with completion. Please try the following with
any zsh 3.x version (including 3.1.5-pws-19) and
enter "foo [tab]":

  compctl -s "\$(cat [tT]his-file-does-not-exist)" foo
 
thanks,
Markus

- -----   Markus F.X.J. Oberhumer <markus.oberhumer@jk.uni-linz.ac.at>   -----
- -----             http://wildsau.idv.uni-linz.ac.at/mfx/               -----
- -----        5E CB 5C 85 DE AF 9E BF  E9 DA 7E 6A 39 F8 CC 67          -----

                             3 WARPS TO URANUS




------- End of Forwarded Message


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

end of thread, other threads:[~1999-06-04 13:15 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-05-31 13:12 forwarded bug report Sven Wischnowsky
1999-05-31 13:05 ` Peter Stephenson
1999-05-31 13:42   ` Andrej Borsenkow
1999-05-31 14:38 ` Tanaka Akira
1999-05-31 18:33   ` Bart Schaefer
  -- strict thread matches above, loose matches on Subject: below --
1999-06-04  9:54 Sven Wischnowsky
1999-06-04  9:40 ` Peter Stephenson
1999-06-04 13:15   ` Tanaka Akira
1999-06-04 10:33 ` Bart Schaefer
1999-05-31 11:40 Peter Stephenson

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