From owner-freebsd-standards@FreeBSD.ORG Tue Oct 2 16:30:25 2012 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1B0901065670 for ; Tue, 2 Oct 2012 16:30:25 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 06B388FC16 for ; Tue, 2 Oct 2012 16:30:25 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q92GUOFT054151 for ; Tue, 2 Oct 2012 16:30:24 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q92GUOCJ054140; Tue, 2 Oct 2012 16:30:24 GMT (envelope-from gnats) Date: Tue, 2 Oct 2012 16:30:24 GMT Message-Id: <201210021630.q92GUOCJ054140@freefall.freebsd.org> To: freebsd-standards@FreeBSD.org From: Andrey Chernov Cc: Subject: Re: standards/172273: unsetenv(3) issue according to autoconf X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Andrey Chernov List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Oct 2012 16:30:25 -0000 The following reply was made to PR standards/172273; it has been noted by GNATS. From: Andrey Chernov To: Ed Maste Cc: FreeBSD-gnats-submit@FreeBSD.org Subject: Re: standards/172273: unsetenv(3) issue according to autoconf Date: Tue, 02 Oct 2012 20:29:33 +0400 This is a multi-part message in MIME format. --------------050507030501080408080306 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit On 02.10.2012 20:08, Andrey Chernov wrote: > Attached simple patch should fix this issue (failing on test 3). Oops, see more correct version attached. --------------050507030501080408080306 Content-Type: text/plain; charset=windows-1251; name="getenv.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="getenv.patch" --- getenv.c.old 2012-10-02 20:01:33.000000000 +0400 +++ getenv.c 2012-10-02 20:25:47.000000000 +0400 @@ -675,11 +675,13 @@ /* Deactivate specified variable. */ envNdx = envVarsTotal - 1; - if (__findenv(name, nameLen, &envNdx, true) != NULL) { + /* Remove all occurences */ + while (__findenv(name, nameLen, &envNdx, true) != NULL) { envVars[envNdx].active = false; if (envVars[envNdx].putenv) __remove_putenv(envNdx); __rebuild_environ(envActive - 1); + envNdx = envVarsTotal - 1; } return (0); --------------050507030501080408080306--