From owner-freebsd-current@FreeBSD.ORG Wed Jul 4 13:53:46 2007 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B5B1B16A400 for ; Wed, 4 Jul 2007 13:53:46 +0000 (UTC) (envelope-from mime@traveller.cz) Received: from nxm.secservers.com (nxm.secservers.com [89.185.226.22]) by mx1.freebsd.org (Postfix) with ESMTP id 4DE4713C48A for ; Wed, 4 Jul 2007 13:53:46 +0000 (UTC) (envelope-from mime@traveller.cz) Received: from [127.0.0.1] (nxm.secservers.com. [89.185.226.22]) by nxm.secservers.com (8.13.4/8.13.8) with ESMTP id l64DrhsV004511; Wed, 4 Jul 2007 15:53:44 +0200 (CEST) (envelope-from mime@traveller.cz) From: Michal Mertl To: freebsd-current , scf@freebsd.org Content-Type: text/plain Date: Wed, 04 Jul 2007 15:53:41 +0200 Message-Id: <1183557221.1799.16.camel@genius.i.cz> Mime-Version: 1.0 X-Mailer: Evolution 2.10.2 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: Subject: Environment handling broken in /bin/sh with changes to {get,set,put}env() X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2007 13:53:46 -0000 Hello, I have just recompiled world to find out that /bin/sh is emitting strange warnings after the recent changes to {get,set,put}env() and sh itself. When the shell starts and locale variables (e.g. LANG) are set in the environment, the warning "sh: environment corrupt; missing value for LANG" gets printed out on the stderr. I have tracked it down to the changes in {get,set,put}env and src/bin/sh/var.c 1.36. I have checked (by inserting printf just before the call) that the arguments passed to putenv() in var.c are reasonable, yet the above mentioned warning is issued. The shell seems to work correctly ('ls -l' shows correct date format in different locales) even when the blocks of code with localevars() (BTW the most cryptic function I've seen in some time) are completely ifdef'ed out. Michal