From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: forwarded bug report
Date: Fri, 4 Jun 1999 11:54:02 +0200 (MET DST) [thread overview]
Message-ID: <199906040954.LAA03159@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: "Bart Schaefer"'s message of Mon, 31 May 1999 18:33:45 +0000
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
next reply other threads:[~1999-06-04 9:54 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-06-04 9:54 Sven Wischnowsky [this message]
1999-06-04 9:40 ` Peter Stephenson
1999-06-04 13:15 ` Tanaka Akira
1999-06-04 10:33 ` Bart Schaefer
-- strict thread matches above, loose matches on Subject: below --
1999-05-31 13:12 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
1999-05-31 11:40 Peter Stephenson
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=199906040954.LAA03159@beta.informatik.hu-berlin.de \
--to=wischnow@informatik.hu-berlin.de \
--cc=zsh-workers@sunsite.auc.dk \
/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).