zsh-workers
 help / color / mirror / code / Atom feed
From: Eric Cook <llua@gmx.com>
To: zsh-workers@zsh.org
Subject: Re: Issue with resolving paths with zsh using \0 in variables
Date: Wed, 14 Jun 2017 23:40:40 -0400	[thread overview]
Message-ID: <60d15cae-f53a-794e-7f86-5cfaa622dfc3@gmx.com> (raw)
In-Reply-To: <170614160224.ZM20305@torch.brasslantern.com>

On 06/14/2017 07:02 PM, Bart Schaefer wrote:

> -- probably is a bug, just not the bug you think it is; the error should
> be that "subdir\0" is an illegal file name, rather than terminating the
> path at the nul and botching the redirection.
> 

I think it is correct, since \0 is in IFS, word splitting happens since the command substitution
isn't quoted. Since zsh will sent the output of a command to multiple destinations if the result
of an expansion is multiple words, it zsh tries to send the output to dir/ and /myfile; but
fails hard when it can't write to dir/, not attempting to write to /myfile.

When the expansion is quoted, you do get the error that you think it should have.


  reply	other threads:[~2017-06-15  3:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-13 19:32 Branden Archer
2017-06-14  0:38 ` Eric Cook
2017-06-14 23:02 ` Bart Schaefer
2017-06-15  3:40   ` Eric Cook [this message]
2017-06-15  4:13     ` Bart Schaefer
2017-06-15  4:22     ` Bart Schaefer

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=60d15cae-f53a-794e-7f86-5cfaa622dfc3@gmx.com \
    --to=llua@gmx.com \
    --cc=zsh-workers@zsh.org \
    /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).