Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
	T_DKIM_INVALID 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=mime-version:in-reply-to:references:date:message-id:subject:from:to
         :cc:content-type;
        bh=0EcGM6WtZ5o4WFt/HIS+GknaGtrP1Bew9k67sbGHjqY=;
        b=ZXw7U88Kekqblt/NlYl7AhuTfakSLpNNvgZpHQLBDJGmVfH2tJvpepw0Lcsh+wZXgm
         ga+zmJGlV3Y4RTLQm2t9Q3P4L0bOuN0wJwohQ0JorEgdN0fgIVtT4RXfjC7SSq9U7tVD
         89ZiswMxZ3hQAx97Y2JLDm7TpLwHgyxCrXoYfNyHZRH3OoQcRsfQaL1qY5knbHn13w8D
         jEDr7Rc+L16I5uX43LVXsMEpNv9NUnpY4IJIQhK3/uj82xrnyZqTTZetrYmdhZ5W8q4y
         /v/M3bQFU2Jx0HY9qtAxnH2E083aAp3ibQDWoixANgwoB4isFLsve3ZysqmMk8z9dK5b
         +4kQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:in-reply-to:references:date
         :message-id:subject:from:to:cc:content-type;
        bh=0EcGM6WtZ5o4WFt/HIS+GknaGtrP1Bew9k67sbGHjqY=;
        b=kv42hLta8QvY4th+fqJ79yDFP3upF+yOc3C46669HAzlK9Fd9gLWrJvmlgAs9+H6CK
         JUiaM+3nBCTbmxnbspM0ryzr3SU1jj3fZPPImzzuHNQ7SFXp/7oxcsCz9nRrU/RIUmBT
         eGprZefht2zODVZ4+Wjs+d94ki9XgftZ/XXCs3kif5eW6JhU/vivc7/GCP0TFWWWZKqt
         UWygtHhle3EZGvJd4nGt2REA8mcS3NU6NUJnENarqFVKVeO+6DWDO7bIoYeJJ9NLGaCd
         istlR/U/wmRNvZo6IbuHc03oRSvnIhFlWpFJnYgFoxTUeZ3MToKIn73lrDp9Zae5aVEa
         +F2g==
X-Gm-Message-State: ALoCoQm+byKByaAUGLfHYxCGoWioseDMQsDbLwnKvbAYh2edXJQwW6LJJ+ek/m7NEX4ERwVL9FiIFLyGG612KfA5cX4bFGOY2A==
MIME-Version: 1.0
X-Received: by 10.140.148.81 with SMTP id 78mr41236352qhu.17.1453220758872;
 Tue, 19 Jan 2016 08:25:58 -0800 (PST)
In-Reply-To: <20160119160344.001b4d2a@pwslap01u.europe.root.pri>
References: <569C68AB.2010806@inlv.org>
	<20160118172434.2fb7d5b9@pwslap01u.europe.root.pri>
	<20160119160344.001b4d2a@pwslap01u.europe.root.pri>
Date: Tue, 19 Jan 2016 17:25:58 +0100
Message-ID: <CAHYJk3RjfBBKzCSQc48Zx2cF_TxXkzMXybR=RL0503wiWFeq6w@mail.gmail.com>
Subject: Re: [BUG] quoting within bracket patterns has no effect
From: Mikael Magnusson <mikachu@gmail.com>
To: Peter Stephenson <p.stephenson@samsung.com>
Cc: "Zsh Hackers' List" <zsh-workers@zsh.org>
Content-Type: text/plain; charset=UTF-8
X-Seq: zsh-workers 37690

On Tue, Jan 19, 2016 at 5:03 PM, Peter Stephenson
<p.stephenson@samsung.com> wrote:
> diff --git a/README b/README
> index 2e2ebce..8ec148e 100644
> --- a/README
> +++ b/README
> @@ -29,17 +29,43 @@ Zsh is a shell with lots of features.  For a list of some of these, see the
>  file FEATURES, and for the latest changes see NEWS.  For more
>  details, see the documentation.
>
> -Incompatibilities between 5.1 and 5.2
> +Incompatibilities between 5.2 and 5.3
>  -------------------------------------
>
> +In character classes delimited by "[" and "]" within patterns, whether
> +used for filename generation (globbing) or other forms of pattern
> +matching, it used not to be possible to quote "-" when used for a range,
> +or "^" and "!" when used for negating a character set.  The chracters can
> +now be quoted by any of the standard shell means, but note that
> +the "[" and "]" must not be quoted.  For example,
> +
> +  [[ $a = ['a-z'] ]]
> +
> +matches if the variable a contains just one of the characters "a", "-"
> +or "z" only.  Previously this would have matched any lower case ASCII
> +letter.  Note therefore the useful fact that
> +
> +  [[ $a = ["$cset"] ]]
> +
> +matches any chracter contained in the variable "cset".  A consequence
> +of this change is that variables that should have active ranges need
> +(with default zsh options) to be indicated explicitly, e.g.
> +
> +  cset="a-z"
> +  [[ b = [${~cset}] ]]
> +
> +The "~" causes the "-" character to be active.  In sh emulation the
> +"~" is unncessary in this example and double quotes must be used to
> +suppress the range behaviour of the "-".

Does this mean [$cset] and ["$cset"] work the same way in zsh
emulation, and [$cset] and [$~cset] work the same in sh emulation?
(character is also somewhat consistently typoed as chracters in two or
three places).

-- 
Mikael Magnusson

