unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Tino Calancha <tino.calancha@gmail.com>
To: 21454@debbugs.gnu.org
Cc: patchwork@newartisans.com, tino.calancha@gmail.com
Subject: bug#21454: 25.0.93; `parse-colon-path' over dirs with 2 consecutive dir sep
Date: Mon, 25 Apr 2016 02:26:30 +0900 (JST)	[thread overview]
Message-ID: <alpine.LRH.2.20.1604250220060.17821@calancha-ilc.kek.jp> (raw)
In-Reply-To: <alpine.LRH.2.20.1509102006260.22763@calancha-ilc.kek.jp>

[-- Attachment #1: Type: text/plain, Size: 1078 bytes --]


There are 2 typos in previous report:

>B) path="$BAZ/bin" ; fails (FOO is not a directory file name)
Should be:
B) path="$BAZ/bin" ; fails (BAZ is not a directory file name)

>let ((foo "/foo/bar/baz/qux/:/quux/corge/:/grault/graply/waldo")) ; `ok'
>  (setenv "FOO" foo)
>  (parse-colon-path "$FOO"))
>("/foo/bar/baz/qux/:/quux/corge/:/grault/graply/waldo/")
It's _not_ ok: `parse-colon-path' returns list with 1 element (don't split on ':').


New patch applied over previous tests returns:

("/foo/bar/baz/" "/qux/quux/corge/")
("/foo/bar/baz/qux/" "/quux/corge/" "/grault/graply/waldo/")
("/foo/bar/baz/qux/" "/quux/corge/" "/grault/graply/waldo/")
("/foo/bar/baz/qux/" "/quux/corge/" "/grault/graply/waldo/")
("/foo/bar/baz/qux/" "/quux/corge/" "/grault/garply/waldo/")
("/foo/bar/baz/qux/" "/quux/corge/" "/grault/garply/waldo/")
("/foo/bar/baz/qux/" "/quux/corge/")
("/foo/bar/baz/qux/" "/quux/corge/")


In GNU Emacs 25.0.93.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.30)
  of 2016-04-25 built on calancha-pc
Repository revision: 0cd2e923dba8d8c7128b0c084ce6af22069e8db5

[-- Attachment #2: Type: text/plain, Size: 1004 bytes --]

diff --git a/lisp/files.el b/lisp/files.el
index 5cdd384..7d92535 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -675,10 +675,14 @@ parse-colon-path
 a leading or trailing separator, or two adjacent separators), return
 nil (meaning `default-directory') as the associated list element."
   (when (stringp search-path)
-    (mapcar (lambda (f)
-	      (if (equal "" f) nil
-		(substitute-in-file-name (file-name-as-directory f))))
-	    (split-string search-path path-separator))))
+    (let ((path (mapconcat 'identity
+                           (mapcar 'substitute-env-vars
+                                   (split-string search-path path-separator))
+                           path-separator)))
+      (mapcar (lambda (f)
+                (if (equal "" f) nil
+                  (file-name-as-directory (expand-file-name f))))
+              (split-string path path-separator)))))
 
 (defun cd-absolute (dir)
   "Change current directory to given absolute file name DIR."

  parent reply	other threads:[~2016-04-24 17:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-10 11:15 bug#21454: 25.0.50; `parse-colon-path' fails with paths containing consecutive directory separators Tino Calancha
2015-09-10 12:48 ` bug#21454: (no subject) Tino Calancha
2016-04-24 17:26 ` Tino Calancha [this message]
2016-09-13  8:55 ` bug#21454: 25.1.50; `parse-colon-path' fails with file names containing multiple consecutive "/" Tino Calancha
2016-09-13  9:16   ` Andreas Schwab
2016-09-13  9:40     ` Tino Calancha
2017-08-31  1:09       ` npostavs
2019-06-25 15:28       ` Lars Ingebrigtsen
2019-06-25 16:29         ` Andreas Schwab
2020-08-12 12:54           ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LRH.2.20.1604250220060.17821@calancha-ilc.kek.jp \
    --to=tino.calancha@gmail.com \
    --cc=21454@debbugs.gnu.org \
    --cc=patchwork@newartisans.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).