From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: owner@emacsbugs.donarmstrong.com (Emacs bug Tracking System) Newsgroups: gmane.emacs.bugs Subject: bug#2062: marked as done (PATH can contain non-expanded variables) Date: Wed, 28 Jan 2009 15:15:03 +0000 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----------=_1233155703-23868-0" X-Trace: ger.gmane.org 1233156279 21688 80.91.229.12 (28 Jan 2009 15:24:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 28 Jan 2009 15:24:39 +0000 (UTC) To: Juanma Barranquero Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jan 28 16:25:50 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LSCIW-0003Od-5F for geb-bug-gnu-emacs@m.gmane.org; Wed, 28 Jan 2009 16:25:49 +0100 Original-Received: from localhost ([127.0.0.1]:37416 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LSCHD-0007xk-VN for geb-bug-gnu-emacs@m.gmane.org; Wed, 28 Jan 2009 10:24:28 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LSCGO-0006zs-Hu for bug-gnu-emacs@gnu.org; Wed, 28 Jan 2009 10:23:36 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LSCGM-0006xg-Qi for bug-gnu-emacs@gnu.org; Wed, 28 Jan 2009 10:23:35 -0500 Original-Received: from [199.232.76.173] (port=59021 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LSCGM-0006xL-KJ for bug-gnu-emacs@gnu.org; Wed, 28 Jan 2009 10:23:34 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:46615) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LSCGL-0005T7-VL for bug-gnu-emacs@gnu.org; Wed, 28 Jan 2009 10:23:34 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n0SFNTrJ026386; Wed, 28 Jan 2009 07:23:30 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n0SFF3go023956; Wed, 28 Jan 2009 07:15:03 -0800 X-Mailer: MIME-tools 5.420 (Entity 5.420) X-Loop: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: closed 2062 X-Emacs-PR-Package: emacs,w32 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:24682 Archived-At: This is a multi-part message in MIME format... ------------=_1233155703-23868-0 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Your message dated Wed, 28 Jan 2009 16:07:03 +0100 with message-id and subject line Re: bug#2062: PATH can contain non-expanded variables has caused the Emacs bug report #2062, regarding PATH can contain non-expanded variables to be marked as done. This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what this message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact owner@emacsbugs.donarmstrong.com immediately.) --=20 2062: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=3D2062 Emacs Bug Tracking System Contact owner@emacsbugs.donarmstrong.com with problems ------------=_1233155703-23868-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by emacsbugs.donarmstrong.com; 26 Jan 2009 13:00:25 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-5.9 required=4.0 tests=FOURLA,HAS_PACKAGE, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mail-ew0-f10.google.com (mail-ew0-f10.google.com [209.85.219.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n0QD0LVZ032728 for ; Mon, 26 Jan 2009 05:00:22 -0800 Received: by ewy3 with SMTP id 3so7135058ewy.1 for ; Mon, 26 Jan 2009 05:00:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=t2ivXmiO+1uL+J8pYlpX7NQQiKdP2JgbJlRYEQc58mw=; b=Xpl44wKZlyRcGkg+MmADaOINGG3Mr53T7OSdmyzBBHS5rqOIEgxANPUjdvYwVYnIHc 7ytpNvAygDpX6H/mtn7R1kQea9fL4flq9+o0PK5Sa/ZSL2/uhJeNIzhcmbp5otfx6+ZI bRfXDFCh2pyvC6d0eCPsU0N0wNLbL1Rp4cxUU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=bymMYHUEeOpi5IUCEvQ2LVqAZ1pc7o8zpv77bqgDdb37asYQFCu69yATbHN9meMJZM f1MLrbzu5KGJVNTigVEnzzjAxiddznTJ85H79TdeIds/ulSdI5KB/qd9s1C/MYm07QRx AgGVJyhPzYMPbqBb51W1pgCVhts/ItAXQi0nw= MIME-Version: 1.0 Received: by 10.210.130.14 with SMTP id c14mr3990754ebd.118.1232974815310; Mon, 26 Jan 2009 05:00:15 -0800 (PST) Date: Mon, 26 Jan 2009 14:00:15 +0100 Message-ID: Subject: PATH can contain non-expanded variables From: Juanma Barranquero To: Emacs Bug Tracker Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Package: emacs,w32 Version: 23.0.60 It is possible for PATH (or other path-like variables, like EMACSPATH and EMACSLOADPATH) to contain unexpanded variables: ELISP> exec-path ("c:/emacs/bin" "%MYTEST%" "C:/WINDOWS/system32" "C:/WINDOWS" "C:/WINDOWS/system32/Wbem" "c:/emacs/trunk/bin") for example, if the user has set "HKLM\Microsoft\Windows\CurrentVersion\App Paths\emacs.exe\Path" as a REG_EXPAND_SZ. These variables should be expanded, but currently emacs.c:decode_env_path does not. The following patch fixes it. Comments? Juanma Index: emacs.c =================================================================== RCS file: /sources/emacs/emacs/src/emacs.c,v retrieving revision 1.461 diff -u -2 -r1.461 emacs.c --- emacs.c 23 Jan 2009 14:53:11 -0000 1.461 +++ emacs.c 26 Jan 2009 12:48:49 -0000 @@ -2467,6 +2467,12 @@ if (path) { +#ifdef WINDOWSNT + DWORD required = ExpandEnvironmentStrings (path, NULL, 0); + p = (char *) alloca (required); + ExpandEnvironmentStrings (path, p, required); +#else p = alloca (strlen (path) + 1); strcpy (p, path); +#endif path = p; ------------=_1233155703-23868-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 2062-close) by emacsbugs.donarmstrong.com; 28 Jan 2009 15:07:08 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.9 required=4.0 tests=FOURLA,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.25]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n0SF74Ex022603 for <2062-close@emacsbugs.donarmstrong.com>; Wed, 28 Jan 2009 07:07:05 -0800 Received: by ey-out-2122.google.com with SMTP id 22so27310eye.13 for <2062-close@emacsbugs.donarmstrong.com>; Wed, 28 Jan 2009 07:07:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=3KpZQpnFC2kle7i7gRdEKLc2CZQQ71e0A7IxNa3jzVI=; b=Hm+jIW2yLzaF0SimowjEiWTtAYyi4X/8ZNTsRcpqhmVplRL7d4ep7oNukqwk1Bo0Ld IHFH8pwrhRiH8ZzqF/aYSqvHw6Weh7n8ukC1J/vJg+i+frw+W3uwd6mi4+4p1lG+JyZ5 cd7zpVZcB2XBWA4oZ16fohn6unqulXwSURxOg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=sBFX46ihuEKulXSQOUOprl/IjoVhoY2vtw0R99ja3WrtQcW90b69yzjA8hzlAOD2vk bTV+UQUK4TNOrb6RypFSp+TOWepJrBT3fnduOXg+kKkcrMsX1m/QwtninyxotjeQmCY+ dgplHrC2A21/v8cuv9uzAmDy2dEoCFAJ/77Oc= MIME-Version: 1.0 Received: by 10.66.248.5 with SMTP id v5mr560300ugh.4.1233155223576; Wed, 28 Jan 2009 07:07:03 -0800 (PST) In-Reply-To: References: <497E69EB.70609@f2s.com> <497ED2B7.2080509@f2s.com> Date: Wed, 28 Jan 2009 16:07:03 +0100 Message-ID: Subject: Re: bug#2062: PATH can contain non-expanded variables From: Juanma Barranquero To: Stefan Monnier Cc: 2062-close@emacsbugs.donarmstrong.com, Eli Zaretskii , jasonr@f2s.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On Wed, Jan 28, 2009 at 15:24, Stefan Monnier wrote: > So your patch works around a bug in some other place which fails to > expand PATH. Not only you're right, but I know which program is causing the problem. Thanks! According to MSDN KB 837633 (and other sources): Windows XP adds the path value, if it exists, to the PATH environment variable, if you use the ShellExecute() function to start your program. So, correctly, Windows Explorer uses App Paths, and CMD.EXE does not (I've checked it). The problem is with TCC (formerly 4NT), a proprietary command shell I use. I had mistakenly assumed that TCC worked like CMD (or, in fact, I did the reverse: because TCC adds App Paths to PATH, I assumed that CMD also did it). But it is not: apparently, TCC is adding App Paths to PATH (which is either a bug or a feature, depending of one's POV), but it's not taking into account that the App Paths entry can be REG_EXPAND_SZ (and that's definitely a bug). I'll report it to them. Juanma ------------=_1233155703-23868-0--