From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13179 invoked by alias); 15 Jun 2017 03:53:47 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 41299 Received: (qmail 14278 invoked from network); 15 Jun 2017 03:53:47 -0000 X-Qmail-Scanner-Diagnostics: from mout.gmx.net by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(212.227.17.22):SA:0(-0.0/5.0):. Processed in 1.358723 secs); 15 Jun 2017 03:53:47 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: llua@gmx.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at gmx.com designates 212.227.17.22 as permitted sender) Subject: Re: Issue with resolving paths with zsh using \0 in variables To: zsh-workers@zsh.org References: <170614160224.ZM20305@torch.brasslantern.com> From: Eric Cook Message-ID: <60d15cae-f53a-794e-7f86-5cfaa622dfc3@gmx.com> Date: Wed, 14 Jun 2017 23:40:40 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <170614160224.ZM20305@torch.brasslantern.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:lXQ9NxcosH6pm8CVxDCfSeG6xOtPSWlatQXfHHjYeGwfEu0v0Wn p4bF2PUJ+wRgBL7HoSffTyV/gKk1BCBZQwm7ngH4NB74i2Uag6fBG6go63nRaofp8K/8F9o xY5mAXeMafDqF8ovho3qnJ+7RQnJg46P9gm7+DbFMPe5m/LZnlmvW17wTc/2+VEGyFYUQbW oygPhzpF0Ff4aXzvSoxqg== X-UI-Out-Filterresults: notjunk:1;V01:K0:A9bq4laWy4c=:0iKy8NVXhcj7KARFk2MuoP jJeMD0T06p8cpN6zxCqcOzWIGOgr0p2V4sqzLrFjx51j1zcXbXZ4bTsgT9bVOObRz1VcHOesj 5fy2rfOGNKnPREV7GI5MAMjbmgmKdEFFPsRjV5QC6rBsBnnXMbjQBL/poX8YXimX60fkWtmVA uLojppq4ujGnhqciw/bb1+2WicyTnsySsOtBhuaj+8U0cz+ImbgtfjVBAhrhpn7VwSz/sg2Wm CkycCTC/76Yo6frn0QTzQBfYyAfc7Fi7wyI0fEBE4BB5+NluBK/2vM3XYKCEsGPo01xLqM/1v iDcu7UbcsJAnO5thHJfKHd0WPdTwMWN7EAH1Ljo6FkwDHthNwE3x/O6HjkzAwRhCRWmcZsov9 s6EodY5xPjBhCWhSjEOQpxfQCmar42fm16aVDtAPL5C2pG+lMFVIH2pSDznwIeK8gdpq/w2yN WaVNz2QboV0ZuZaWH5dPXqp68Eq7QexRLtwgU3UDnRDjxyVSguW14zoqDRexZri8l9sAnVwve YXWQ6GbkRRp2iV/Le7VU5uHIDsgdSG5iEhuhcmR8Yuk06Ws7/kqnchV+ltdj6xSYHhi7yJy5/ muof/FMnsTW0j4i2dIne8/3Nt5n2D5pmpBzlXRO3ZTHpVjQYU9DQyNh+hsnKJ2HEVpv0EBeu4 u9v1O7m0ifdQjwJJPiBN23F+ojHoy/0hSgfIWyboG6ysJLKFInzm6noYUFe8xLQxFuLwP+Xko +x1iLJ2l6poNYOK6rzhrTmcsElc3dD63nMXZYrXsqsTLAlRA6Bza7XfLf/B519xcILa3h4uM6 ds/VAon 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.