GNU bug report logs - #21454
25.0.50; `parse-colon-path' fails with paths containing consecutive directory separators

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Tino Calancha <f92capac@HIDDEN>; Keywords: patch; dated Thu, 10 Sep 2015 11:13:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Added tag(s) patch. Request was from Lars Magne Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 21454 <at> debbugs.gnu.org:


Received: (at 21454) by debbugs.gnu.org; 24 Apr 2016 17:25:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 24 13:25:32 2016
Received: from localhost ([127.0.0.1]:45202 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1auNmm-000242-Mf
	for submit <at> debbugs.gnu.org; Sun, 24 Apr 2016 13:25:32 -0400
Received: from calancha-ilc.kek.jp ([130.87.234.234]:35138)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <tino.calancha@HIDDEN>) id 1auNkg-00020n-MO
 for 21454 <at> debbugs.gnu.org; Sun, 24 Apr 2016 13:23:23 -0400
Received: by calancha-ilc.kek.jp (Postfix, from userid 500)
 id 63EA072D6; Mon, 25 Apr 2016 02:26:30 +0900 (JST)
Received: from localhost (localhost [127.0.0.1])
 by calancha-ilc.kek.jp (Postfix) with ESMTP id 45A71421C;
 Mon, 25 Apr 2016 02:26:30 +0900 (JST)
Date: Mon, 25 Apr 2016 02:26:30 +0900 (JST)
From: Tino Calancha <tino.calancha@HIDDEN>
X-X-Sender: calancha@HIDDEN
To: 21454 <at> debbugs.gnu.org
Subject: 25.0.93; `parse-colon-path' over dirs with 2 consecutive dir sep
Message-ID: <alpine.LRH.2.20.1604250220060.17821@HIDDEN>
User-Agent: Alpine 2.20 (LRH 67 2015-01-07)
MIME-Version: 1.0
Content-Type: multipart/mixed;
 BOUNDARY="1468197610-2121233049-1461518790=:17821"
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 21454
X-Mailman-Approved-At: Sun, 24 Apr 2016 13:25:30 -0400
Cc: patchwork@HIDDEN, tino.calancha@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.0 (+)

--1468197610-2121233049-1461518790=:17821
Content-Type: text/plain; format=flowed; charset=US-ASCII


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
--1468197610-2121233049-1461518790=:17821
Content-Type: text/plain; charset=US-ASCII; name=files.patch
Content-Transfer-Encoding: BASE64
Content-ID: <alpine.LRH.2.20.1604250226300.17821@HIDDEN>
Content-Description: 
Content-Disposition: attachment; filename=files.patch

ZGlmZiAtLWdpdCBhL2xpc3AvZmlsZXMuZWwgYi9saXNwL2ZpbGVzLmVsDQpp
bmRleCA1Y2RkMzg0Li43ZDkyNTM1IDEwMDY0NA0KLS0tIGEvbGlzcC9maWxl
cy5lbA0KKysrIGIvbGlzcC9maWxlcy5lbA0KQEAgLTY3NSwxMCArNjc1LDE0
IEBAIHBhcnNlLWNvbG9uLXBhdGgNCiBhIGxlYWRpbmcgb3IgdHJhaWxpbmcg
c2VwYXJhdG9yLCBvciB0d28gYWRqYWNlbnQgc2VwYXJhdG9ycyksIHJldHVy
bg0KIG5pbCAobWVhbmluZyBgZGVmYXVsdC1kaXJlY3RvcnknKSBhcyB0aGUg
YXNzb2NpYXRlZCBsaXN0IGVsZW1lbnQuIg0KICAgKHdoZW4gKHN0cmluZ3Ag
c2VhcmNoLXBhdGgpDQotICAgIChtYXBjYXIgKGxhbWJkYSAoZikNCi0JICAg
ICAgKGlmIChlcXVhbCAiIiBmKSBuaWwNCi0JCShzdWJzdGl0dXRlLWluLWZp
bGUtbmFtZSAoZmlsZS1uYW1lLWFzLWRpcmVjdG9yeSBmKSkpKQ0KLQkgICAg
KHNwbGl0LXN0cmluZyBzZWFyY2gtcGF0aCBwYXRoLXNlcGFyYXRvcikpKSkN
CisgICAgKGxldCAoKHBhdGggKG1hcGNvbmNhdCAnaWRlbnRpdHkNCisgICAg
ICAgICAgICAgICAgICAgICAgICAgICAobWFwY2FyICdzdWJzdGl0dXRlLWVu
di12YXJzDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAo
c3BsaXQtc3RyaW5nIHNlYXJjaC1wYXRoIHBhdGgtc2VwYXJhdG9yKSkNCisg
ICAgICAgICAgICAgICAgICAgICAgICAgICBwYXRoLXNlcGFyYXRvcikpKQ0K
KyAgICAgIChtYXBjYXIgKGxhbWJkYSAoZikNCisgICAgICAgICAgICAgICAg
KGlmIChlcXVhbCAiIiBmKSBuaWwNCisgICAgICAgICAgICAgICAgICAoZmls
ZS1uYW1lLWFzLWRpcmVjdG9yeSAoZXhwYW5kLWZpbGUtbmFtZSBmKSkpKQ0K
KyAgICAgICAgICAgICAgKHNwbGl0LXN0cmluZyBwYXRoIHBhdGgtc2VwYXJh
dG9yKSkpKSkNCiANCiAoZGVmdW4gY2QtYWJzb2x1dGUgKGRpcikNCiAgICJD
aGFuZ2UgY3VycmVudCBkaXJlY3RvcnkgdG8gZ2l2ZW4gYWJzb2x1dGUgZmls
ZSBuYW1lIERJUi4iDQo=

--1468197610-2121233049-1461518790=:17821--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#21454; Package emacs. Full text available.

Message received at 21454 <at> debbugs.gnu.org:


Received: (at 21454) by debbugs.gnu.org; 10 Sep 2015 12:45:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 10 08:45:31 2015
Received: from localhost ([127.0.0.1]:54618 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Za1EI-0000tQ-Dv
	for submit <at> debbugs.gnu.org; Thu, 10 Sep 2015 08:45:31 -0400
Received: from calancha-ilc.kek.jp ([130.87.234.234]:51722)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <f92capac@HIDDEN>) id 1Za1EF-0000tG-IR
 for 21454 <at> debbugs.gnu.org; Thu, 10 Sep 2015 08:45:28 -0400
Received: by calancha-ilc.kek.jp (Postfix, from userid 500)
 id 18F0DB799; Thu, 10 Sep 2015 21:48:32 +0900 (JST)
Received: from localhost (localhost [127.0.0.1])
 by calancha-ilc.kek.jp (Postfix) with ESMTP id 0341942F;
 Thu, 10 Sep 2015 21:48:32 +0900 (JST)
Date: Thu, 10 Sep 2015 21:48:31 +0900 (JST)
From: Tino Calancha <f92capac@HIDDEN>
X-X-Sender: calancha@HIDDEN
To: 21454 <at> debbugs.gnu.org
Message-ID: <alpine.LRH.2.20.1509102144430.23072@HIDDEN>
User-Agent: Alpine 2.20 (LRH 67 2015-01-07)
MIME-Version: 1.0
Content-Type: multipart/mixed;
 BOUNDARY="1468197610-1176952358-1441889312=:23072"
X-Spam-Score: 2.9 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has
 identified this incoming email as possible spam.  The original message
 has been attached to this so you can view it (if it isn't spam) or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  Previous patch renamed `parse-colon-path' with a different
 name. Attached the patch using the right name. --- files.el 2015-09-10
 19:31:06.569650962
 +0900 +++ files_patched.el 2015-09-10 21:42:02.045650024 +0900 @@ -667,6
 +667,7 @@ "Value of the CDPATH environment variable, as a list. Not actually
 set up until the first time you use it.") [...] 
 Content analysis details:   (2.9 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider
 (f92capac[at]gmail.com)
 1.0 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
 1.8 MISSING_SUBJECT        Missing Subject: header
 0.2 NO_SUBJECT             Extra score for no subject
X-Debbugs-Envelope-To: 21454
Cc: "C. Calancha" <f92capac@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 2.9 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has
 identified this incoming email as possible spam.  The original message
 has been attached to this so you can view it (if it isn't spam) or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  Previous patch renamed `parse-colon-path' with a different
    name. Attached the patch using the right name. --- files.el 2015-09-10 19:31:06.569650962
    +0900 +++ files_patched.el 2015-09-10 21:42:02.045650024 +0900 @@ -667,6
   +667,7 @@ "Value of the CDPATH environment variable, as a list. Not actually
    set up until the first time you use it.") [...] 
 
 Content analysis details:   (2.9 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail provider
                             (f92capac[at]gmail.com)
  1.0 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
  1.8 MISSING_SUBJECT        Missing Subject: header
  0.2 NO_SUBJECT             Extra score for no subject

--1468197610-1176952358-1441889312=:23072
Content-Type: text/plain; format=flowed; charset=US-ASCII


Previous patch renamed `parse-colon-path' with a different name. 
Attached the patch using the right name.
--1468197610-1176952358-1441889312=:23072
Content-Type: text/plain; charset=US-ASCII; name=files.patch
Content-Transfer-Encoding: BASE64
Content-ID: <alp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gICAoc3BsaXQtc3RyaW5nIHNlYXJj
aC1wYXRoIHBhdGgtc2VwYXJhdG9yKSkpKQ0KKyAgICAobGV0KiAoKHBhdGgt
bGlzdCAgICAgICAgKG1hcGNhciAnc3Vic3RpdHV0ZS1lbnYtdmFycyAoc3Bs
aXQtc3RyaW5nIHNlYXJjaC1wYXRoIHBhdGgtc2VwYXJhdG9yKSkpDQorICAg
ICAgICAgICAoc2VhcmNoLXBhdGgtc3ViICAobWFwY29uY2F0ICdpZGVudGl0
eSBwYXRoLWxpc3QgcGF0aC1zZXBhcmF0b3IpKSkNCisgICAgICAobWFwY2Fy
IChsYW1iZGEgKGYpDQorICAgICAgICAgICAgICAgIChpZiAoZXF1YWwgIiIg
ZikgbmlsDQorICAgICAgICAgICAgICAgICAgKGV4cGFuZC1maWxlLW5hbWUg
KGZpbGUtbmFtZS1hcy1kaXJlY3RvcnkgZikpKSkNCisgICAgICAgICAgICAg
IChzcGxpdC1zdHJpbmcgc2VhcmNoLXBhdGgtc3ViIHBhdGgtc2VwYXJhdG9y
KSkpKSkNCiANCiAoZGVmdW4gY2QtYWJzb2x1dGUgKGRpcikNCiAgICJDaGFu
Z2UgY3VycmVudCBkaXJlY3RvcnkgdG8gZ2l2ZW4gYWJzb2x1dGUgZmlsZSBu
YW1lIERJUi4iDQo=

--1468197610-1176952358-1441889312=:23072--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#21454; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 10 Sep 2015 11:12:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 10 07:12:50 2015
Received: from localhost ([127.0.0.1]:54549 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ZZzmb-0005fm-N8
	for submit <at> debbugs.gnu.org; Thu, 10 Sep 2015 07:12:50 -0400
Received: from eggs.gnu.org ([208.118.235.92]:41206)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <f92capac@HIDDEN>) id 1ZZzmZ-0005fc-0e
 for submit <at> debbugs.gnu.org; Thu, 10 Sep 2015 07:12:48 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <f92capac@HIDDEN>) id 1ZZzmX-00045I-CM
 for submit <at> debbugs.gnu.org; Thu, 10 Sep 2015 07:12:46 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM
 autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:59437)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <f92capac@HIDDEN>) id 1ZZzmX-00045E-9S
 for submit <at> debbugs.gnu.org; Thu, 10 Sep 2015 07:12:45 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:51191)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <f92capac@HIDDEN>) id 1ZZzmV-0005no-Qc
 for bug-gnu-emacs@HIDDEN; Thu, 10 Sep 2015 07:12:45 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <f92capac@HIDDEN>) id 1ZZzmR-000444-O2
 for bug-gnu-emacs@HIDDEN; Thu, 10 Sep 2015 07:12:43 -0400
Received: from calancha-ilc.kek.jp ([130.87.234.234]:58174)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <f92capac@HIDDEN>) id 1ZZzmR-000430-7P
 for bug-gnu-emacs@HIDDEN; Thu, 10 Sep 2015 07:12:39 -0400
Received: by calancha-ilc.kek.jp (Postfix, from userid 500)
 id 6497DB79B; Thu, 10 Sep 2015 20:15:42 +0900 (JST)
Received: from localhost (localhost [127.0.0.1])
 by calancha-ilc.kek.jp (Postfix) with ESMTP id 4E4B7B798;
 Thu, 10 Sep 2015 20:15:42 +0900 (JST)
Date: Thu, 10 Sep 2015 20:15:42 +0900 (JST)
From: Tino Calancha <f92capac@HIDDEN>
X-X-Sender: calancha@HIDDEN
To: bug-gnu-emacs@HIDDEN
Subject: 25.0.50; `parse-colon-path' fails with paths containing consecutive
 directory separators
Message-ID: <alpine.LRH.2.20.1509102006260.22763@HIDDEN>
User-Agent: Alpine 2.20 (LRH 67 2015-01-07)
MIME-Version: 1.0
Content-Type: multipart/mixed;
 BOUNDARY="1468197610-1601033166-1441883742=:22763"
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
X-Debbugs-Envelope-To: submit
Cc: "C. Calancha" <f92capac@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.0 (----)

--1468197610-1601033166-1441883742=:22763
Content-Type: text/plain; format=flowed; charset=US-ASCII



Implementation use `substitute-in-file-name' which substitute environment variables but 
also drop all in front of consecutive directory separators (up to the last 
of those dir. separators). The documentation of `parse-colon-path' dont 
mention about that behaviour.

In unix systems there is no difference between:

I)  /foo//bar/baz
II) /foo/bar/baz

`substitute-in-file-name' would translate I) into:
/bar/baz

In case path to parse contains an environment variable:
FOO=/foo/bar
BAZ=/foo/bar/

A) path="$FOO/bin" ; works (FOO is a directory file name)
B) path="$BAZ/bin" ; fails (FOO is not a directory file name)


Observed same behaviour on this fuction in emacs versions: 19, 20, 21, 22, 
23, 24 and 25.
Attached patch calls `substitute-env-in-file-name' instead of 
`substitute-in-file-name' and it returns same values for 
inputs I) and II) or A) and B).

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
In *scratch* buffer after started session with:
emacs -Q

(let* ((foo "/foo/bar//baz/:/qux/quux/corge//")) ; '//'
   (setenv "FOO" foo)
   (parse-colon-path (getenv "FOO")))
("/baz/" "/")

(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/")

(let ((foo "/foo/bar/baz/qux/:/quux/corge/:/grault/graply/waldo/")) ; end with '/' and `parse-colon-path' add another
   (setenv "FOO" foo)
   (parse-colon-path "$FOO"))
("/")

(let ((foo "/foo/bar/baz/qux/:/quux/corge/:/grault/graply/waldo/")) ; `getenv' makes it work somehow
   (setenv "FOO" foo)
   (parse-colon-path (getenv "FOO")))
("/foo/bar/baz/qux/" "/quux/corge/" "/grault/graply/waldo/")

(let ((foo "/foo/bar/baz//qux/:/quux/corge/:/grault/garply/waldo/")) ; `getenv' dont help with '//'
   (setenv "FOO" foo)
   (parse-colon-path (getenv "FOO")))
("/qux/" "/quux/corge/" "/grault/garply/waldo/")

(let ((foo "/foo/bar/baz//qux/:/quux/corge/:/grault/garply/waldo")) ; '//'
   (setenv "FOO" foo)
   (parse-colon-path "$FOO"))
("/qux/:/quux/corge/:/grault/garply/waldo/")

(let* ((foo "/foo/bar")                    ; `ok' foo not end with '/'
        (bar "$FOO/baz/qux/:/quux/corge/"))
   (setenv "FOO" foo)
   (setenv "BAR" bar)
   (parse-colon-path (getenv "BAR")))
("/foo/bar/baz/qux/" "/quux/corge/")

(let* ((foo "/foo/bar/")                   ; foo ends with '/'
 	   (bar "$FOO/baz/qux/:/quux/corge/"))
   (setenv "FOO" foo)
   (setenv "BAR" bar)
   (parse-colon-path (getenv "BAR")))
("/baz/qux/" "/quux/corge/")


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

In GNU Emacs 25.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.23)
  of 2015-09-10
Repository revision: f962c5d6472804f788cdd54631bcc46aab5f59ce
Windowing system distributor 'Scientific Linux', version 11.0.11500000
System Description:	Scientific Linux release 6.7 (Carbon)

Configured using:
  'configure --without-makeinfo --with-gif=no'

Configured features:
XPM JPEG TIFF PNG IMAGEMAGICK SOUND DBUS GCONF NOTIFY LIBSELINUX LIBXML2
FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK2 X11

Important settings:
   value of $LANG: en_US.utf8
   value of $XMODIFIERS: @im=none
   locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
   tooltip-mode: t
   global-eldoc-mode: t
   electric-indent-mode: t
   mouse-wheel-mode: t
   tool-bar-mode: t
   menu-bar-mode: t
   file-name-shadow-mode: t
   global-font-lock-mode: t
   font-lock-mode: t
   blink-cursor-mode: t
   auto-composition-mode: t
   auto-encryption-mode: t
   auto-compression-mode: t
   line-number-mode: t
   transient-mark-mode: t

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
<backtab> is undefined
Quit
completing-read-default: Command attempted to use minibuffer while in minibuffer
user-error: Beginning of history; no preceding item
Quit [2 times]

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message dired format-spec
rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util help-fns help-mode easymenu cl-loaddefs pcase cl-lib mail-prsvr
mail-utils time-date mule-util tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel x-win term/common-win x-dnd
tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment
elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan
thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian
slovak czech european ethiopic indian cyrillic chinese charscript
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote dbusbind inotify
dynamic-setting system-font-setting font-render-setting move-toolbar gtk
x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 80421 12421)
  (symbols 48 18940 0)
  (miscs 40 39 110)
  (strings 32 12495 3997)
  (string-bytes 1 361986)
  (vectors 16 11158)
  (vector-slots 8 408984 7901)
  (floats 8 131 123)
  (intervals 56 192 0)
  (buffers 976 12)
  (heap 1024 26696 621))
--1468197610-1601033166-1441883742=:22763
Content-Type: text/plain; charset=US-ASCII; name=files.patch
Content-Transfer-Encoding: BASE64
Content-ID: <alpine.LRH.2.20.1509102015420.22763@HIDDEN>
Content-Description: 
Content-Disposition: attachment; filename=files.patch

LS0tIGZpbGVzLmVsCTIwMTUtMDktMTAgMTk6MzE6MDYuNTY5NjUwOTYyICsw
OTAwDQorKysgZmlsZXNfcGF0Y2hlZC5lbAkyMDE1LTA5LTEwIDIwOjAxOjAw
LjMwMzY1MDc0OCArMDkwMA0KQEAgLTY2Nyw3ICs2NjcsOCBAQA0KICAgIlZh
bHVlIG9mIHRoZSBDRFBBVEggZW52aXJvbm1lbnQgdmFyaWFibGUsIGFzIGEg
bGlzdC4NCiBOb3QgYWN0dWFsbHkgc2V0IH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
dGgtc2VwYXJhdG9yKSkpDQorICAgICAgICAgICAoc2VhcmNoLXBhdGgtc3Vi
ICAobWFwY29uY2F0ICdpZGVudGl0eSBwYXRoLWxpc3QgcGF0aC1zZXBhcmF0
b3IpKSkNCisgICAgICAobWFwY2FyIChsYW1iZGEgKGYpDQorICAgICAgICAg
ICAgICAgIChpZiAoZXF1YWwgIiIgZikgbmlsDQorICAgICAgICAgICAgICAg
ICAgKGV4cGFuZC1maWxlLW5hbWUgKGZpbGUtbmFtZS1hcy1kaXJlY3Rvcnkg
ZikpKSkNCisgICAgICAgICAgICAgIChzcGxpdC1zdHJpbmcgc2VhcmNoLXBh
dGgtc3ViIHBhdGgtc2VwYXJhdG9yKSkpKSkNCiANCiAoZGVmdW4gY2QtYWJz
b2x1dGUgKGRpcikNCiAgICJDaGFuZ2UgY3VycmVudCBkaXJlY3RvcnkgdG8g
Z2l2ZW4gYWJzb2x1dGUgZmlsZSBuYW1lIERJUi4iDQo=

--1468197610-1601033166-1441883742=:22763--




Acknowledgement sent to Tino Calancha <f92capac@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#21454; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Apr 2016 22:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.