From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11956 invoked from network); 23 Oct 2004 16:45:58 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 23 Oct 2004 16:45:58 -0000 Received: (qmail 16389 invoked from network); 22 Oct 2004 15:45:51 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 22 Oct 2004 15:45:51 -0000 Received: (qmail 20764 invoked by alias); 22 Oct 2004 15:45:39 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20514 Received: (qmail 20750 invoked from network); 22 Oct 2004 15:45:38 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 22 Oct 2004 15:45:38 -0000 Received: (qmail 15785 invoked from network); 22 Oct 2004 15:44:41 -0000 Received: from moonbase.zanshin.com (64.84.47.139) by a.mx.sunsite.dk with SMTP; 22 Oct 2004 15:44:39 -0000 Received: from toltec.zanshin.com (toltec.zanshin.com [64.84.47.166]) by moonbase.zanshin.com (8.13.1/8.13.1) with ESMTP id i9MFiXeb011544; Fri, 22 Oct 2004 08:44:35 -0700 Date: Fri, 22 Oct 2004 08:44:33 -0700 (PDT) From: Bart Schaefer Reply-To: zsh-workers@sunsite.dk To: Alexey Tourbin cc: zsh-workers@sunsite.dk Subject: Re: bug: _store_cache and ksh arrays In-Reply-To: <20041019141510.GN2017@solemn.turbinal.org> Message-ID: References: <20041019024827.GI2017@solemn.turbinal.org> <20041019141510.GN2017@solemn.turbinal.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=0.0 required=6.0 tests=none autolearn=no version=2.63 X-Spam-Hits: 0.0 On Tue, 19 Oct 2004, Alexey Tourbin wrote: > Actually _comp_options neither set no unset KSH_TYPESET along with > MAGIC_EQUAL_SUBST. Hence the problem. Here is a patch. _comp_options can't change MAGIC_EQUAL_SUBST because some completers behave differently depending on an [[ -o magicequalsubst ]] test. Just NO_kshtypeset should be sufficient. > Anyway I can't understand why "$var=( ${(kv@Pqq)^^var} )" should give > only one element for array with those options set. I know why it happens, but I think it's a bug. However, it might be just a documentation bug rather than a code bug. Here's the doc: MAGIC_EQUAL_SUBST All unquoted arguments of the form `ANYTHING=EXPRESSION' appearing after the command name have filename expansion (that is, where EXPRESSION has a leading `~' or `=') performed on EXPRESSION as if it were a parameter assignment. The argument is not otherwise treated specially; it is passed to the command as a single argument, and not used as an actual parameter assignment. For example, in echo foo=~/bar:~/rod, both occurrences of ~ would be replaced. Note that this happens anyway with typeset and similar statements. This option respects the setting of the KSH_TYPESET option. In other words, if both options are in effect, arguments looking like assignments will not undergo wordsplitting. The problem is with the word "unquoted" in the first line above. It would seem that MAGIC_EQUAL_SUBST applies to double-quoted arguments, and only single quoting entirely protects them. In the absence of KSH_TYPESET this is not apparent, because double-quoting is sufficient to prevent filename expansion, but with KSH_TYPESET the side-effect on parameter expansion is revealed.