NAMESTRING of tilde + directory that doesn't exist doesn't expand the tilde

Bug #1853833 reported by Vinced
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Invalid
Undecided
Unassigned

Bug Description

I was expecting that (namestring "~/nothinghere"), a tilde with a directory name that doesn't exist locally, would expand to "/home/user/nothinghere", but it just leaves the tilde.

In CLisp and CCL, the tilde is expanded.

Same for PATHNAME.

This point is mentioned in https://bugs.launchpad.net/sbcl/+bug/1790330.

---

SBCL 1.4.5.debian

Linux 5.0.0-31-generic #33~18.04.1-Ubuntu SMP Tue Oct 1 10:20:39 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

*features*
(:PLUMP-UTF-32 :CHUNGA :FLEXI-STREAMS CHIPZ-SYSTEM:GRAY-STREAMS :FAST-IO-SV
 :FAST-IO :SBCL-USES-SB-ROTATE-BYTE :CLOSER-MOP :SPLIT-SEQUENCE
 :ESRAP.CAN-HANDLE-LEFT-RECURSION :ESRAP.MULTIPLE-TRANSFORMS
 :ESRAP.FUNCTION-TERMINALS :ESRAP.EXPRESSION-START-TERMINALS :ESRAP.LOOKBEHIND
 :ESRAP.LOOKAHEAD :CL-FAD :CL-PPCRE :BORDEAUX-THREADS :THREAD-SUPPORT :SWANK
 CFFI-FEATURES:FLAT-NAMESPACE CFFI-FEATURES:X86-64 CFFI-FEATURES:UNIX :CFFI
 CFFI-SYS::FLAT-NAMESPACE ALEXANDRIA.0.DEV::SEQUENCE-EMPTYP :QUICKLISP
 :SB-BSD-SOCKETS-ADDRINFO :ASDF3.3 :ASDF3.2 :ASDF3.1 :ASDF3 :ASDF2 :ASDF
 :OS-UNIX :NON-BASE-CHARS-EXIST-P :ASDF-UNICODE :64-BIT :64-BIT-REGISTERS
 :ALIEN-CALLBACKS :ANSI-CL :ASH-RIGHT-VOPS :C-STACK-IS-CONTROL-STACK
 :CALL-SYMBOL :COMMON-LISP :COMPACT-INSTANCE-HEADER :COMPARE-AND-SWAP-VOPS
 :COMPLEX-FLOAT-VOPS :CYCLE-COUNTER :ELF :FLOAT-EQL-VOPS
 :FP-AND-PC-STANDARD-SAVE :GCC-TLS :GENCGC :IEEE-FLOATING-POINT :IMMOBILE-CODE
 :IMMOBILE-SPACE :INLINE-CONSTANTS :INTEGER-EQL-VOP :LARGEFILE :LINKAGE-TABLE
 :LINUX :LITTLE-ENDIAN :MEMORY-BARRIER-VOPS :MULTIPLY-HIGH-VOPS
 :OS-PROVIDES-BLKSIZE-T :OS-PROVIDES-DLADDR :OS-PROVIDES-DLOPEN
 :OS-PROVIDES-GETPROTOBY-R :OS-PROVIDES-POLL :OS-PROVIDES-PUTWC
 :OS-PROVIDES-SUSECONDS-T :PACKAGE-LOCAL-NICKNAMES :RAW-INSTANCE-INIT-VOPS
 :RAW-SIGNED-WORD :RELOCATABLE-HEAP :SB-AFTER-XC-CORE :SB-CORE-COMPRESSION
 :SB-DOC :SB-EVAL :SB-FUTEX :SB-LDB :SB-PACKAGE-LOCKS :SB-SIMD-PACK
 :SB-SOURCE-LOCATIONS :SB-THREAD :SB-UNICODE :SB-XREF-FOR-INTERNALS :SBCL
 :STACK-ALLOCATABLE-CLOSURES :STACK-ALLOCATABLE-FIXED-OBJECTS
 :STACK-ALLOCATABLE-LISTS :STACK-ALLOCATABLE-VECTORS
 :STACK-GROWS-DOWNWARD-NOT-UPWARD :SYMBOL-INFO-VOPS :UNBIND-N-VOP
 :UNDEFINED-FUN-RESTARTS :UNIX :UNWIND-TO-FRAME-AND-CALL-VOP :X86-64)

Revision history for this message
Stas Boukarev (stassats) wrote :

namestring doesn't expand any ~, existing or not.

Changed in sbcl:
status: New → Invalid
Revision history for this message
Vinced (vincezd) wrote :

Damn right. I'd find great if it did, as in some other implementations.

truename doesn't, but that is expected, well documented, and consistent with other implementations.

Revision history for this message
Stas Boukarev (stassats) wrote :

CCL doesn't expand in namestring either, it does it before the pathname is constructed.

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.