Defective case diddling in PATHNAME-DIRECTORY breaks round-tripping.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Low
|
Unassigned |
Bug Description
Defective case diddling in PATHNAME-DIRECTORY breaks round-tripping.
Two problems in SB-IMPL:
1. PATHNAME-DIRECTORY with case :COMMON does not convert lettercase when there is any lettercase variation in all characters in the directory, but MAKE-PATHNAME with case :COMMON handles the lettercase of each directory element individually:
--
$ sh ./run-sbcl.sh --no-userinit --no-sysinit
(running SBCL from: .)
This is SBCL 1.4.2.276-0288458, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://
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-directory "/AB/cd/" :case :common)
(:ABSOLUTE "AB" "cd")
* (make-pathname :case :common :directory (pathname-directory "/AB/cd/" :case :common))
#P"/ab/CD/"
* (pathname-directory #P"/Ab/cd/EF/" :case :common)
(:ABSOLUTE "Ab" "cd" "EF")
* (make-pathname :directory (pathname-directory "/Ab/cd/EF/" :case :common) :case :common)
#P"/Ab/CD/ef/"
--
2. PATHNAME-DIRECTORY doesn't diddle lettercase inside SB-IMPL::PATTERN instances, but MAKE-PATHNAME does:
--
* (pathname-directory "/a*b/" :case :common)
(:ABSOLUTE #<SB-IMPL::PATTERN "a" :MULTI-CHAR-WILD "b">)
* (make-pathname :case :common :directory (pathname-directory "/a*b/" :case :common))
#P"/A*B/"
--
In the above scenarios, I expected round-tripping when using the same values for CASE.
ANSI is ambiguous-
(lambda (x) (make-pathname :case :common :name x))
and have a consistent denotation.
The attached patch changes changes SB-IMPL:
Other requested info:
--
* $ uname -a
Darwin m5.localdomain 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 PDT 2015; root:xnu-
* *features*
(:64-BIT :64-BIT-REGISTERS :ALIEN-CALLBACKS :ANSI-CL :ASH-RIGHT-VOPS :BSD
:C-STACK-
:COMPARE-
:DARWIN9-OR-BETTER :FLOAT-EQL-VOPS :FP-AND-
:IEEE-
:INTEGER-EQL-VOP :LINKAGE-TABLE :LITTLE-ENDIAN :MACH-EXCEPTION
:MEMORY-
:OS-PROVIDES-
:OS-PROVIDES-
:RAW-INSTANCE-
:SB-LDB :SB-PACKAGE-LOCKS :SB-SIMD-PACK :SB-SOURCE-
:SB-UNICODE :SBCL :STACK-
:STACK-
:STACK-
:UNBIND-N-VOP :UNDEFINED-
:X86-64)
--
Changed in sbcl: | |
assignee: | nobody → Jan Moringen (scymtym) |
importance: | Undecided → Low |
status: | New → Confirmed |
Changed in sbcl: | |
status: | Confirmed → Fix Committed |
assignee: | Jan Moringen (scymtym) → nobody |
Changed in sbcl: | |
status: | Fix Committed → Fix Released |
Whoops, this proves to be a duplicate of https:/ /bugs.launchpad .net/sbcl/ +bug/695486
Sorry for the noise.