From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6311 invoked by alias); 10 Dec 2012 18:22:00 -0000 Received: (qmail 6299 invoked by uid 22791); 10 Dec 2012 18:21:58 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 10 Dec 2012 18:21:52 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id D9686CB3D0A for ; Mon, 10 Dec 2012 19:21:56 +0100 (CET) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id g8s1BxPsTNzv for ; Mon, 10 Dec 2012 19:21:56 +0100 (CET) Received: from chelles.act-europe.fr (chelles.act-europe.fr [10.10.0.160]) by mel.act-europe.fr (Postfix) with ESMTP id C8A3FCB3D08 for ; Mon, 10 Dec 2012 19:21:56 +0100 (CET) Received: by chelles.act-europe.fr (Postfix, from userid 560) id C4F931EA005A; Mon, 10 Dec 2012 19:21:56 +0100 (CET) Date: Mon, 10 Dec 2012 18:22:00 -0000 From: Jerome Guitton To: gdb-patches@sourceware.org Subject: Re: [RFA/mingw32] environment variables are case-insensitive on win32 Message-ID: <20121210182156.GF17188@adacore.com> References: <20121203113147.GB12055@adacore.com> <20121209235344.GA12152@ednor.casa.cgf.cx> <20121210105115.GB15147@adacore.com> <20121210110128.GA12570@calimero.vinschen.de> <20121210134935.GL31477@adacore.com> <20121210153510.GB17188@adacore.com> <002401cdd6f0$c0b317b0$42194710$@muller@ics-cnrs.unistra.fr> <20121210161831.GH15147@adacore.com> <000001cdd6f3$2d12b490$87381db0$@muller@ics-cnrs.unistra.fr> <20121210165344.GC16027@calimero.vinschen.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20121210165344.GC16027@calimero.vinschen.de> User-Agent: Mutt/1.5.21 (2010-09-15) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-12/txt/msg00265.txt.bz2 Corinna Vinschen (vinschen@redhat.com): > Only the Win32 function GetEnviromentVariable searches the environment > case-insensitive, and SetEnviromentVariable overwrites the first > occurence of a variable after a case-insensitive search. These > functions are also used by CMD.EXE, so that it's case-insensitive as > well. > > But that doesn't affect the ability to handle case-sensitive environments > in applications NOT using GetEnviromentVariable/SetEnviromentVariable. > > If you give an environment to the CreateProcess function it will go > unchanged to the inferior process. Fetching the complete environment > with GetEnvironmentStrings in the inferior will show the full, > unchanged, environment, with as much variables only differing by case as > you like. Thank you very much for this clarification Corinna! At this point I feel that the most sensible thing to do for mingw32 is to have case-insensitive env vars, even though on certain circonstances case-sensitivity would work. I have one other good reason to think that: the path command does not work today in mingw32 when running the debugger from CMD.EXE. That is caused by the fact the corresponding environment variable has a different casing than PATH: it's 'Path' (at least on my machine). So a case-sensitive lookup fails, a new variable 'PATH' is created in the environment vector, and the inferior ends up with a truncated environment.