From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dave Abrahams Newsgroups: gmane.emacs.bugs Subject: bug#12351: 24.1; parse-colon-path turns empty paths into nil Date: Sun, 30 Dec 2012 22:11:19 -0500 Message-ID: References: <83licfjnny.fsf@gnu.org> <85fw2nq9mi.fsf@iznogoud.viz> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1356923524 10130 80.91.229.3 (31 Dec 2012 03:12:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 31 Dec 2012 03:12:04 +0000 (UTC) Cc: 12351@debbugs.gnu.org To: Wolfgang Jenkner Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Dec 31 04:12:20 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TpVnW-0007tb-80 for geb-bug-gnu-emacs@m.gmane.org; Mon, 31 Dec 2012 04:12:18 +0100 Original-Received: from localhost ([::1]:33058 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TpVnH-0002F1-A6 for geb-bug-gnu-emacs@m.gmane.org; Sun, 30 Dec 2012 22:12:03 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:45927) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TpVnE-0002Ev-LT for bug-gnu-emacs@gnu.org; Sun, 30 Dec 2012 22:12:01 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TpVn9-0001MT-6j for bug-gnu-emacs@gnu.org; Sun, 30 Dec 2012 22:12:00 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:55462) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TpVn9-0001MO-3U for bug-gnu-emacs@gnu.org; Sun, 30 Dec 2012 22:11:55 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TpVoE-0006YZ-7z for bug-gnu-emacs@gnu.org; Sun, 30 Dec 2012 22:13:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dave Abrahams Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 31 Dec 2012 03:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12351 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 12351-submit@debbugs.gnu.org id=B12351.135692355225169 (code B ref 12351); Mon, 31 Dec 2012 03:13:02 +0000 Original-Received: (at 12351) by debbugs.gnu.org; 31 Dec 2012 03:12:32 +0000 Original-Received: from localhost ([127.0.0.1]:37480 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TpVnk-0006Xt-7a for submit@debbugs.gnu.org; Sun, 30 Dec 2012 22:12:32 -0500 Original-Received: from mail-vb0-f51.google.com ([209.85.212.51]:53399) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TpVnh-0006Xj-Oq for 12351@debbugs.gnu.org; Sun, 30 Dec 2012 22:12:30 -0500 Original-Received: by mail-vb0-f51.google.com with SMTP id fq11so12614267vbb.10 for <12351@debbugs.gnu.org>; Sun, 30 Dec 2012 19:11:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type:x-gm-message-state; bh=/g4nUMTRJIVDWt5rQKY0GKl1HxrS89nXsVZpbDDtwho=; b=M2REgIzHFA5MZfsISm6nJRmNDGOJ54FPmt5rKBxR8f8FkZewMmwFsjOC4scVAxlaSe uXABRm5Krgfi0EYJ5zcTrgp7NwHm2ru63oGYlHl8pdhbqavu+aQmELnfqIgXrPGtNKxG cw56A3vlaqAHkorvGOIWfDuywozrQN6VhNALHgU1+2XeWB+6W7/LkzaNddD19oT+4PgX JuDvSMr+7d3ipCSyDccjpDpvnOweuN0zvLBMPV86UunX1Jy2jhdpatTPqM7bPECk+H2E PAlgeADc/eL6l06wl4Pen2PLWZuwbxJX5tQ4FhWjWHf8PpQ+CHo+HTbI+ceFkH9c7F1M FWSQ== X-Received: by 10.52.22.107 with SMTP id c11mr54543811vdf.73.1356923482081; Sun, 30 Dec 2012 19:11:22 -0800 (PST) Original-Received: from pluto.boostpro.com (207-172-223-249.c3-0.smr-ubr3.sbo-smr.ma.static.cable.rcn.com. [207.172.223.249]) by mx.google.com with ESMTPS id cd19sm37419897vdb.20.2012.12.30.19.11.20 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 30 Dec 2012 19:11:21 -0800 (PST) Original-Received: by pluto.boostpro.com (Postfix, from userid 501) id 873269B0EBB; Sun, 30 Dec 2012 22:11:19 -0500 (EST) In-Reply-To: <85fw2nq9mi.fsf@iznogoud.viz> (Wolfgang Jenkner's message of "Mon, 31 Dec 2012 02:40:21 +0100") User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2 (darwin) X-Gm-Message-State: ALoCoQkeSfqwochpI5/rJzMS7/S4hHHHjY06ZGy1V4TqUf6lt0T1bO3MBZ23tfly+qIEMyv9K4rY X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:69218 Archived-At: on Sun Dec 30 2012, Wolfgang Jenkner wrote: > On Sun, Dec 30 2012, Dave Abrahams wrote: > >> The following function is buggy because of the original bug: >> >> (defun osx-plist-update-exec-path () >> "Update `exec-path' from the PATH environment variable." >> (let ((path (getenv "PATH"))) >> (mapc (lambda (dir) >> (add-to-list 'exec-path dir)) >> (parse-colon-path path))) >> exec-path) >> >> I had to replace it in my local installation as follows: >> >> (defun osx-plist-update-exec-path () >> "Update `exec-path' from the PATH environment variable." >> (let ((path (delq nil (parse-colon-path (getenv "PATH"))))) >> (setq exec-path >> (dolist (dir exec-path path) >> (add-to-list 'path (file-name-as-directory dir) :append))))) > > But the first function exhibited a bug only with an empty component in > the path. So I'd guess that nil ought to be replaced by "." instead of > being deleted from the list. No, that would be wrong. Every OS I know of treats empty elements in "colon paths" (semicolon paths on Windows) differently from elements that are "." > If the second function gives the correct result that means that > exec-path already contained "." before the call. > > And in any case, wouldn't the trivial patch (relative to trunk) below do > the right thing here? > > Confused, > > Wolfgang > > === modified file 'lisp/files.el' > --- lisp/files.el 2012-12-17 15:51:49 +0000 > +++ lisp/files.el 2012-12-31 01:00:47 +0000 > @@ -664,7 +664,7 @@ > (when (stringp search-path) > (mapcar (lambda (f) > (substitute-in-file-name (file-name-as-directory f))) > - (split-string search-path path-separator t)))) > + (split-string search-path path-separator)))) > > (defun cd-absolute (dir) > "Change current directory to given absolute file name DIR." It depends whether you think the "right thing" is the old behavior or the documented behavior or something else. -- Dave Abrahams BoostPro Computing Software Development Training http://www.boostpro.com Clang/LLVM/EDG Compilers C++ Boost