From owner-freebsd-current@FreeBSD.ORG Sat Jul 14 01:43:24 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 576EA16A404; Sat, 14 Jul 2007 01:43:24 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (nagual.pp.ru [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 8AA8513C48D; Sat, 14 Jul 2007 01:43:23 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.14.1/8.14.1) with ESMTP id l6E1hM0w024846; Sat, 14 Jul 2007 05:43:22 +0400 (MSD) (envelope-from ache@nagual.pp.ru) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nagual.pp.ru; s=default; t=1184377402; bh=cqG1GgT7+17+LF0aB3isszVCX/lcICWoSAGN3lH S2X8=; l=434; h=Received:Date:From:To:Cc:Subject:Message-ID: Mail-Followup-To:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To:User-Agent; b=k6Cd/x9L1hhrDgfin21Y 6aIMF0UyppRLKjvqExfA8ZY1hVwxPI2lr3bVbnG+ESyH+QmxxCw5iYJop/gdCp6OxRX FLXKAfjzYWnulJodAa9cNxPB8wxLbBnmr7UrPDAfNBXScFRm3cioO8DCz3LC4x0XQGs KZMpbiRyYb7MJhW2c= Received: (from ache@localhost) by nagual.pp.ru (8.14.1/8.14.1/Submit) id l6E1hLVO024845; Sat, 14 Jul 2007 05:43:21 +0400 (MSD) (envelope-from ache) Date: Sat, 14 Jul 2007 05:43:20 +0400 From: Andrey Chernov To: "Sean C. Farley" Message-ID: <20070714014319.GA24701@nagual.pp.ru> Mail-Followup-To: Andrey Chernov , "Sean C. Farley" , freebsd-current References: <20070708171727.GA90490@nagual.pp.ru> <20070713162742.GA16260@nagual.pp.ru> <20070713142545.K26096@thor.farley.org> <20070713202433.GA19856@nagual.pp.ru> <20070713203915.GA20270@nagual.pp.ru> <20070713171942.Q26096@thor.farley.org> <20070713224608.GB21695@nagual.pp.ru> <20070713184543.A26096@thor.farley.org> <20070714004116.GA22909@nagual.pp.ru> <20070713200048.X26971@thor.farley.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070713200048.X26971@thor.farley.org> User-Agent: Mutt/1.5.16 (2007-06-09) Cc: freebsd-current Subject: Re: Environment handling broken in /bin/sh with changes to t,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: Sat, 14 Jul 2007 01:43:24 -0000 On Fri, Jul 13, 2007 at 08:10:33PM -0500, Sean C. Farley wrote: >> It ends up with environ = NULL; because envVarsTotal initialized to 0 >> i.e. makes from "environ[0] == NULL" case "environ == NULL" case >> which is different thing. > > I changed it to return (0) if either environ or environ[0] equal NULL. > The SaveEnviron label is removed as well as the (envVarsTotal > 0) > check. Looks OK. -- http://ache.pp.ru/