From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 220 invoked from network); 1 Feb 2005 13:32:50 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 1 Feb 2005 13:32:50 -0000 Received: (qmail 40652 invoked from network); 1 Feb 2005 13:32:42 -0000 Received: from unknown (HELO sunsite.dk) (130.225.247.90) by a.mx.sunsite.dk with SMTP; 1 Feb 2005 13:32:42 -0000 Received: (qmail 29659 invoked by alias); 1 Feb 2005 10:56:23 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20769 Received: (qmail 29648 invoked from network); 1 Feb 2005 10:56:23 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 1 Feb 2005 10:56:23 -0000 Received: (qmail 81136 invoked from network); 1 Feb 2005 10:55:49 -0000 Received: from smtp-out2.blueyonder.co.uk (195.188.213.5) by a.mx.sunsite.dk with SMTP; 1 Feb 2005 10:55:45 -0000 Received: from localhost ([82.41.211.153]) by smtp-out2.blueyonder.co.uk with Microsoft SMTPSVC(5.0.2195.6713); Tue, 1 Feb 2005 10:56:18 +0000 Date: Tue, 1 Feb 2005 10:57:32 +0000 From: Stephane Chazelas To: zsh-workers@sunsite.dk Subject: Re: Umount completion fails when mount point or dev node contains spaces Message-ID: <20050201105732.GA4548@sc> Mail-Followup-To: zsh-workers@sunsite.dk References: <87d5vl6qf1.fsf@ceramic.fifi.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87d5vl6qf1.fsf@ceramic.fifi.org> User-Agent: Mutt/1.5.6i X-OriginalArrivalTime: 01 Feb 2005 10:56:18.0488 (UTC) FILETIME=[A8592B80:01C5084C] X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.5 required=6.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.5 On Mon, Jan 31, 2005 at 05:05:06PM -0800, Philippe Troin wrote: [...] > # umount /mnt/mount\\040point\[\\134 > > The enclosed patch takes care of the problem by unescaping octal > sequences. > [...] > + dev_tmp=(${dev_tmp//(#b)(\\([0-7]##|\\))/$(print $match[1])}) Note that this would fail for foo\012bar for ((i = 1; i <= $#dev_tmp; i++)); do eval "dev_tmp[i]=\$'${dev_tmp[i]}'" done should work and avoid the forks for $(print ...) $ sudo mkdir '/mnt/f\n\1oo quote> bar' ~$ sudo mount --bind /tmp $_ ~$ tail -1 /etc/mtab /tmp /mnt/f\134n\1341oo\012bar none rw,bind 0 0 ~$ dev_tmp=('/mnt/f\134n\1341oo\012bar') ~$ print -rl -- ${dev_tmp//(#b)(\\([0-7]##|\\))/$(print $match[1])} /mnt/f\n\1oobar ~$ dev_tmp=('/mnt/f\134n\1341oo\012bar') ~$ for ((i = 1; i <= $#dev_tmp; i++)); do for> eval "dev_tmp[i]=\$'${dev_tmp[i]}'" for> done ~$ print -rl "${(@)dev_tmp}" /mnt/f\n\1oo bar -- Stéphane