From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Wolfgang Jenkner Newsgroups: gmane.emacs.bugs Subject: bug#12351: 24.1; parse-colon-path turns empty paths into nil Date: Mon, 31 Dec 2012 02:40:21 +0100 Message-ID: <85fw2nq9mi.fsf@iznogoud.viz> References: <83licfjnny.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1356918241 9037 80.91.229.3 (31 Dec 2012 01:44:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 31 Dec 2012 01:44:01 +0000 (UTC) Cc: 12351@debbugs.gnu.org To: Dave Abrahams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Dec 31 02:44:17 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 1TpUQJ-000807-1M for geb-bug-gnu-emacs@m.gmane.org; Mon, 31 Dec 2012 02:44:15 +0100 Original-Received: from localhost ([::1]:54794 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TpUQ4-0001f6-5j for geb-bug-gnu-emacs@m.gmane.org; Sun, 30 Dec 2012 20:44:00 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:60024) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TpUQ1-0001f0-ML for bug-gnu-emacs@gnu.org; Sun, 30 Dec 2012 20:43:58 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TpUQ0-0004cU-HK for bug-gnu-emacs@gnu.org; Sun, 30 Dec 2012 20:43:57 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:55426) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TpUQ0-0004cQ-Dn for bug-gnu-emacs@gnu.org; Sun, 30 Dec 2012 20:43:56 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TpUR4-0004U6-Rx for bug-gnu-emacs@gnu.org; Sun, 30 Dec 2012 20:45:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Wolfgang Jenkner Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 31 Dec 2012 01:45: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.135691828817202 (code B ref 12351); Mon, 31 Dec 2012 01:45:02 +0000 Original-Received: (at 12351) by debbugs.gnu.org; 31 Dec 2012 01:44:48 +0000 Original-Received: from localhost ([127.0.0.1]:37444 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TpUQp-0004TO-8b for submit@debbugs.gnu.org; Sun, 30 Dec 2012 20:44:48 -0500 Original-Received: from mx04.lb01.inode.at ([62.99.145.4]:43059 helo=mx.inode.at) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TpUQl-0004TA-OQ for 12351@debbugs.gnu.org; Sun, 30 Dec 2012 20:44:45 -0500 Original-Received: from [91.119.206.19] (port=11974 helo=iznogoud.viz) by smartmx-04.inode.at with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1TpUPf-0001RU-SG; Mon, 31 Dec 2012 02:43:35 +0100 Original-Received: from wolfgang by iznogoud.viz with local (Exim 4.80.1 (FreeBSD)) (envelope-from ) id 1TpUPe-0000jn-6a; Mon, 31 Dec 2012 02:43:34 +0100 User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (berkeley-unix) 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:69212 Archived-At: 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. 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."