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=iuRjdbwvQzwq7Z5xWjhc4f4p6hjb1f3j/QTqsZMw9M0=;
        b=MxYlUpYcAZhVSUC9C+w8I+RIhd3agejcOAf2+dmVh2YQvssv4M1xJQS9+gXipiNowJ
         HNUc8PlCCfkYkcInLduRvZPhLz3u38iqRG0mMobxUwzgPMjavPSjXJa7IFN/Y1frsMZ0
         snfQRuGRxu4MFMZagNunAlcocbgKFLblBZojfOcLT13ojrzAsQ+Y6ON5C/dvfSPd0Ju1
         U/x1cGw0NcO1N8rI0Psvnj9omERCOJH4XtHjAVC6KpldZCAPgYeLcFa8iaGVU/HFVjmx
         OAjC8LHF/bLimbf+2GrkTOa3sUX1PEolLgo8d5Vwm5MDqTYB+LY/wLyeDDY8uFuanNxR
         lI3g==
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=iuRjdbwvQzwq7Z5xWjhc4f4p6hjb1f3j/QTqsZMw9M0=;
        b=gSQmD8gNG+7OMQxYw138j+IUvXLikIUE///arcEHuGPYVtpNELrtL2RHJdu4ihwo52
         35evsavKgMO9xz9l1Q2heMNKtbUD4ZnCWjmBQitqPfK88nnh/jduYcF1pBKvLPGsFzdb
         KF1X8aInmZVuZWnYU9f8LxkANt664h+PQdM38/B1MXOcm4MMLvSPRw8rdS+9het2sQfp
         JeWXdZyNsXw9Igapxp/rvo8ZbAXHe5WJiYjuQt+5Jd2NtFEiu+n7BULAz0iy44n5Afwf
         4xub9FXo6v9cU6yIg0+IJnUWFHqk/ume5QfoobvMQ94LYHbYrhaSNk8d9ZsMOzfTz7P4
         gYjA==
X-Gm-Message-State: AG10YOR0P/DSJaZOIrfgzR76pwnGEkC42+37fDNvECthgP4NU2ehKi8db7dObsRQtur5m8eprXD4BX2cwttVWw==
MIME-Version: 1.0
X-Received: by 10.140.134.197 with SMTP id 188mr7838199qhg.58.1453507661453;
 Fri, 22 Jan 2016 16:07:41 -0800 (PST)
In-Reply-To: <56A294F9.5020509@inlv.org>
References: <87h9jujttm.fsf@gmail.com>
	<20151207135532.1a285c15@pwslap01u.europe.root.pri>
	<878u56jpob.fsf@gmail.com>
	<20151207143621.3cbbe7bd@pwslap01u.europe.root.pri>
	<56A28D28.3090701@inlv.org>
	<56A294F9.5020509@inlv.org>
Date: Sat, 23 Jan 2016 01:07:41 +0100
Message-ID: <CAHYJk3Qi-N3J2Np6w1Jqm_J+4=ip+kpGwhpQhi74L3osmfnYgw@mail.gmail.com>
Subject: Re: ${path[@]} in sh mode [was: Segfault with zsh 5.2]
From: Mikael Magnusson <mikachu@gmail.com>
To: Martijn Dekker <martijn@inlv.org>
Cc: Peter Stephenson <p.stephenson@samsung.com>, zsh workers <zsh-workers@zsh.org>
Content-Type: text/plain; charset=UTF-8
X-Seq: zsh-workers 37732

On Fri, Jan 22, 2016 at 9:45 PM, Martijn Dekker <martijn@inlv.org> wrote:
> Martijn Dekker schreef op 22-01-16 om 20:12:
>> Peter Stephenson schreef op 07-12-15 om 14:36:
>>> Change now pushed.
>>
>> Can the ${path[@]} array be disabled in sh mode? I just noticed that it
>> auto-syncs with the system $PATH. Lowercase "path" is a perfectly normal
>> variable name in other shells and is a common English word, so conflicts
>> that result in corruption of $PATH are not unlikely when running scripts
>> written using other shells.
>
> Never mind: it is disabled when zsh is launched as sh (but not when
> launched as zsh and then executing 'emulate sh'). So I suppose it was
> decided long before that disabling it post-launch is not feasible. Sorry
> for the noise.

If you're in a function context, you can say 'typeset -h path' to hide
the specialness of $path and declare a new local of the same name. Eg,
one that isn't connected to PATH.

-- 
Mikael Magnusson

