zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Alexey Tourbin <at@altlinux.ru>
Cc: zsh-workers@sunsite.dk
Subject: Re: bug: _store_cache and ksh arrays
Date: Fri, 22 Oct 2004 08:44:33 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.61.0410220823440.23496@toltec.zanshin.com> (raw)
In-Reply-To: <20041019141510.GN2017@solemn.turbinal.org>

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.


      reply	other threads:[~2004-10-23 16:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-19  2:48 Alexey Tourbin
2004-10-19  4:54 ` Bart Schaefer
2004-10-19 12:49   ` Alexey Tourbin
2004-10-19 14:15   ` Alexey Tourbin
2004-10-22 15:44     ` Bart Schaefer [this message]

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=Pine.LNX.4.61.0410220823440.23496@toltec.zanshin.com \
    --to=schaefer@brasslantern.com \
    --cc=at@altlinux.ru \
    --cc=zsh-workers@sunsite.dk \
    /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).