From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17371 invoked by alias); 18 Aug 2015 16:20:46 -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: 36231 Received: (qmail 16512 invoked from network); 18 Aug 2015 16:20:45 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=d2k0VDWwaRWeEmInlC57t0nsZYDGDttLAaUnTHUUsCo=; b=opb0AKrIayRzF4E+i+mU+65K2eU154q1XKW7LeiKHY9+iTPATQm2IsVUH3exj7JMNY qzuClz8VEUDBl5GADvnWh+SPtsfUS/eOox+nzPo6WHt11LgIZo8X48T/D5AETXHFnvzE /mB5B5XsD2IPadco/L1OhDcdWZlA2dDp0YLmnpdiPzgIlYdEfh7FLL2vF4xCYByduBHP oC2GkYWQ29/A24rzq62cht9AZeebC2CkL1ChKk2Gh4yIiAIul4JGjMh7elp+qfYb3Thq Yd0lZihIzKRVkXh/DVVDm0PxgLH1ld9GFbASAF2ZGAWYHCnGW86RvshlKN7SBdcjrLrW bjvQ== X-Received: by 10.195.12.76 with SMTP id eo12mr15631519wjd.51.1439914842224; Tue, 18 Aug 2015 09:20:42 -0700 (PDT) Date: Tue, 18 Aug 2015 17:20:40 +0100 From: Stephane Chazelas To: Zsh hackers list Subject: Re: mkdir builtin and $'\0' Message-ID: <20150818162040.GC5629@chaz.gmail.com> Mail-Followup-To: Zsh hackers list References: <20150818091904.GA5389@chaz.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20150818091904.GA5389@chaz.gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) 2015-08-18 10:19:04 +0100, Stephane Chazelas: [...] > A bit worse: > > $ strace -e chdir zsh -c "cd $'a\0b'; print -r -- \$PWD; pwd" > chdir("/export/home/stephane/a") = -1 ENOENT (No such file or directory) > chdir("a\203 b") = 0 > chdir("..") = 0 > chdir("..") = 0 > chdir("..") = 0 > chdir("/home/stephane/a\203 b") = 0 > /export/home/stephane/a > /home/stephane/a� b > +++ exited with 0 +++ > > I suppose the chdir("..")s come after the realisation that $PWD > probably doesn't represent the current directory anymore (since > chdir("$PWD/dir") doesn't work while chdir("dir") does). [...] How about my "cd" case? The discrepancy between $PWD and pwd is strange there. -- Stephane