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.1 (2015-04-28) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID
	autolearn=ham autolearn_force=no version=3.4.1
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=brasslantern-com.20150623.gappssmtp.com; s=20150623;
        h=from:message-id:date:in-reply-to:comments:references:to:subject
         :mime-version;
        bh=LMZ7+nG1E2sx5yBXEJ3SzdheqsGhfY+JQnMDqZoGuUw=;
        b=geOBbZg60ZDlVrSyEh0Nv/qDdA+sVjMbOVQNCblRrA38Fp0JTTo62sUhZV1piRqQwr
         fiS4wHeId8uJEY0MU72syKEG3rLAuGp9zsp1xyIYf7KkLfqJjdscJbE0UBMBhmH6l5L6
         Hf3YzA/jvsvd4NhROC5IZInzKuCSm6illG73Jv5tg0OpViR303EIIWuYCH7wms2AO59r
         klz6xnUUdpvDQRJB8IXmxg5MXxO15FfSfan1n2QP/YjyYqvFeR1UpGze5dObZwKS2Ieg
         CkIcDHX9UPTKgDJRk3tHIrG0fNMaA+W8jn8jKqQh79JONJB9kDPUXF8QYw18D1566pgm
         mkqQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:from:message-id:date:in-reply-to:comments
         :references:to:subject:mime-version;
        bh=LMZ7+nG1E2sx5yBXEJ3SzdheqsGhfY+JQnMDqZoGuUw=;
        b=BOT5wgHKIKtwIbMswVCQbVJCODS8Xpb5CsKCVJinzOJhltkqpa3aq80XPIVruTCuFH
         1paRwxoj+3KdGhr7wmROGpmaDMrHPdcdSS5F+nY6HtA11NIalYPHojTQf5q75xuWc60j
         S8dLQyGjFlNQLnegP/6QvATO1U6CEQufK+wA6SC/kO06sHzlQFLxffP0J04QYVHM+8Kg
         B21Zoa/SzV3h6FVbiqPl9nQvC2V3cg6tSIs5I9TKPuQbFYvKvVvThjK9qPVnbsGwiRZl
         hO0CHfJNn2lDUEBuI2SlukeoTFsrJTxrGE+2971+ULMo2IPacsa78GuZjaFMOM77amGy
         JB2Q==
X-Gm-Message-State: AOPr4FWnN9BehLm6Gkp79fSqIvgKCgXctKQMveHXPvY8PTwUEDtSFCrzwBtuc4ACttdkQg==
X-Received: by 10.98.47.66 with SMTP id v63mr30473637pfv.67.1462738998462;
        Sun, 08 May 2016 13:23:18 -0700 (PDT)
From: Bart Schaefer <schaefer@brasslantern.com>
Message-Id: <160508132406.ZM10234@torch.brasslantern.com>
Date: Sun, 8 May 2016 13:24:06 -0700
In-Reply-To: <20160508201217.5924511a@ntlworld.com>
Comments: In reply to Peter Stephenson <p.w.stephenson@ntlworld.com>
        "Re: leading '=' in enviroment variable truncated" (May  8,  8:12pm)
References: <CAEyFG7ZkxS9iuVtEoJT2aa_ErBm=Nm6JqkpSgt=-=3P-nuZBtg@mail.gmail.com> 
	<160508105949.ZM9904@torch.brasslantern.com> 
	<20160508201217.5924511a@ntlworld.com>
X-Mailer: OpenZMail Classic (0.9.2 24April2005)
To: zsh-workers@zsh.org
Subject: Re: leading '=' in enviroment variable truncated
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Seq: zsh-workers 38432

On May 8,  8:12pm, Peter Stephenson wrote:
} Subject: Re: leading '=' in enviroment variable truncated
}
} On Sun, 8 May 2016 10:59:49 -0700
} Bart Schaefer <schaefer@brasslantern.com> wrote:
} 
} > As mentioned in the dotenv issue, this happens only on OSX.  I've just
} > confirmed that it's a problem either with the library implementations
} > of setenv() / unsetenv(), or with zsh's use of them.
} 
}   These functions set, unset and fetch environment variables from the host
}   environment list.  For compatibility with differing environment
}   conven-tions, conventions, the given arguments name and value may be
}   appended and prepended, respectively, with an equal sign ``=''.
} 
} Very useful, if I may say so.

Astounding.

The Open Group spec for "setenv" explicitly prohibits "=" in the name,
and says nothing about the value.  The source code for setenv.c on
opensource.apple.com does nothing special with name or value.

How about this?


diff --git a/Src/zsh_system.h b/Src/zsh_system.h
index 811340d..17c4c64 100644
--- a/Src/zsh_system.h
+++ b/Src/zsh_system.h
@@ -728,7 +728,7 @@ extern char **environ;
  * We always need setenv and unsetenv in pairs, because
  * we don't know how to do memory management on the values set.
  */
-#if defined(HAVE_SETENV) && defined(HAVE_UNSETENV)
+#if defined(HAVE_SETENV) && defined(HAVE_UNSETENV) && !defined(__APPLE__)
 # define USE_SET_UNSET_ENV
 #endif
 

