Raymond Toy pushed to branch issue-266-b-tilde-pathname-support at cmucl / cmucl

Commits:

1 changed file:

Changes:

  • src/code/filesys.lisp
    ... ... @@ -303,14 +303,9 @@
    303 303
     
    
    304 304
     (defun user-homedir-namestring (name)
    
    305 305
       (cond ((zerop (length name))
    
    306
    -         (let ((user (unix:unix-getpwuid (unix:unix-getuid))))
    
    307
    -           (concatenate 'simple-base-string
    
    308
    -                        (unix:user-info-dir user))))
    
    306
    +         (unix:user-info-dir (unix:unix-getpwuid (unix:unix-getuid))))
    
    309 307
             (t
    
    310
    -         (let ((path (system:get-user-homedir-namestring name)))
    
    311
    -           (unless path
    
    312
    -             (error "Unknown user: ~S" name))
    
    313
    -           path))))
    
    308
    +         (system:get-user-homedir-namestring name))))
    
    314 309
     
    
    315 310
     (defun replace-tilde-user (str start end)
    
    316 311
       ;; Quick exit if STR doesn't start with ~ or we have an empty string.
    
    ... ... @@ -326,6 +321,8 @@
    326 321
             (values str start end)))
    
    327 322
         (let* ((user-name (subseq str (1+ start) end-user))
    
    328 323
                (homedir (user-homedir-namestring user-name)))
    
    324
    +      (unless homedir
    
    325
    +        (error "Unknown user ~S in namestring ~S" user-name (subseq str start end)))
    
    329 326
           ;; Replace the ~user part with the home directory, adjusting END
    
    330 327
           ;; because of the replacement.
    
    331 328
           (values (concatenate 'simple-base-string