From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7066 invoked by alias); 13 Jul 2017 23:13:40 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 41424 Received: (qmail 8439 invoked from network); 13 Jul 2017 23:13:40 -0000 X-Qmail-Scanner-Diagnostics: from mail-qt0-f175.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.216.175):SA:0(0.5/5.0):. Processed in 3.433956 secs); 13 Jul 2017 23:13:40 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.5 required=5.0 tests=RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RCVD_IN_SORBS_SPAM,SPF_PASS, T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.216.175 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=5BN1XNt/iv2b5zk493/tbVgRph5ANkPD7gHxMAfGDXM=; b=oaS4QHazsCrKzrfzvv8qFiDqbLUbAW5F/qXjGQFJvOIPrejhjZmuaLd+nDwT+WK8jE OdUvMMuM9NOB6/M0q5Pv5Sm48zucjqj7IrGXZKrquQSvY4qMtL7Hr2done1F9z0WEsRb r74UfKL9RwWyg8LxHvTkylLAVn9lk/66o3KDmL2Uk9pvQ5tAnjb9YdLFDbRt8FIp7GWw 3Et9ZGN75i5rOj0WLdM+QE/9Pf57uCujmBymXBwn4NM7XfSfyGaRlLnbA/wducqmxJ19 Evr7NrEKpyDEUZtEM/tkb5edOioIG+WQNMkJRkMkSCTAFT3HgR6mNjrdDTbScL5D0AsW iZPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=5BN1XNt/iv2b5zk493/tbVgRph5ANkPD7gHxMAfGDXM=; b=unhvjr8JQXiTvwZEPnfrVYhf+FRJjq7QQvwY056ijHS3GWbUt4dj8I8e12V/P+ghQW 5T24g4wFiPt7humgjjM8ARotohaYR3Qbia8uwI0X0wtHxprYWCk0EBLj+Nodibm3HbGr MlvMGd5Vb69Q1WALSGyQcasRUmdzCgteJFW5pXKPVLqJ1vqoo7HeHdNjMcKYSDn11N9k fLaxhN7s1sE70AJ57T6tanE33H8/PGwgUpxLXd0Fi1VSFmjDITrQgGjxViIfRJ6oIHT0 ILyxyyqQONaUeV5e8/KavwDrzvPx3YxgYV4UbFO17TtYF59dQX5zVKkNoTYsIBgHUaCi ea1A== X-Gm-Message-State: AIVw112Kg2SehzQumPndij9bkiQoGdRD/6o7VL1xIeOYUT6TOeUn9hr9 PESlqmEV1Onhb0Fm1LYjNbOlOa0Mk4xaJ24= X-Received: by 10.237.61.153 with SMTP id i25mr8616312qtf.239.1499987611121; Thu, 13 Jul 2017 16:13:31 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Bart Schaefer Date: Thu, 13 Jul 2017 16:13:30 -0700 Message-ID: Subject: Re: Environment variables with nonstandard names are silently dropped on macOS To: "zsh-workers@zsh.org" Content-Type: text/plain; charset="UTF-8" On Thu, Jul 13, 2017 at 2:07 PM, Radon Rosborough wrote: > > env FOO.BAR=QUUX zsh -c 'printenv FOO.BAR' > > In Zsh 5.2 on all operating systems, this prints QUUX. In Zsh 5.3.1 on > macOS (but not elsewhere), it prints nothing and returns nonzero. > > The bug was introduced in commit 9dffe404a464289aedade8762795ee4d1bbb1d3f, > which adds a special case for macOS pertaining to environment variable > handling. This patch merely changes one #define from config.h, to cause putenv() to be used in place of setenv() -- there is no other code change. Unfortunately discarding putenv() as well does not have any effect on this, because "FOO.BAR" is not a valid identifier in zsh --- you can't write ${FOO.BAR} without getting "zsh:1: bad substitution" -- and in fact I don't see how it ever worked with setenv() either, because the loop that imports the environment skips anything that doesn't match zsh's definition of an identifier.