Unparsing pattern components doesn't escape special characters

Bug #1738803 reported by Richard M Kreuter
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
New
Undecided
Unassigned

Bug Description

Producing a namestring for a Unix pathname with an SB-IMPL::PATTERN component doesn't escape any characters in the pattern. As all characters inside a PATTERN are literals, if the pattern contains any characters with special syntax, the namestring doesn't parse back to the right pathname.

--
$ sh run-sbcl.sh --no-userinit --no-sysinit
(running SBCL from: .)
This is SBCL 1.3.2.69-aff4a0f, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
* (pathname-name "*\\*")

#<SB-IMPL::PATTERN :MULTI-CHAR-WILD "*">
* (namestring (pathname "*\\*"))

"**"
* (equal (pathname "*\\*") (parse-namestring (namestring (pathname "*\\*"))))

NIL
--

By inspection, CMUCL evinces the same behavior, so this might have be around "forever" (but I haven't checked).

The attached patch fixes this bug.

Revision history for this message
Richard M Kreuter (kreuter) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.