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

Commits:

3 changed files:

Changes:

  • src/code/filesys.lisp
    ... ... @@ -1085,12 +1085,16 @@ optionally keeping some of the most recent old versions."
    1085 1085
     	       hash))))
    
    1086 1086
     
    
    1087 1087
     (defun user-homedir-namestring (&optional username)
    
    1088
    +  "Returns the namestring for the user's home directory.  If Username is
    
    1089
    +  not specified, then use the current user."
    
    1088 1090
       (flet ((unix-user-homedir (username)
    
    1089
    -	   (let ((user-info (unix::unix-getpwnam-tmp username)))
    
    1090
    -             (if user-info (unix:user-info-dir user-info))))
    
    1091
    +	   (let ((user-homedir (system:get-user-homedir-pathname username)))
    
    1092
    +             (when user-homedir
    
    1093
    +               (namestring user-homedir))))
    
    1091 1094
     	 (unix-uid-homedir (uid)
    
    1092 1095
     	   (let ((user-info (unix::unix-getpwuid uid)))
    
    1093
    -             (if user-info (unix:user-info-dir user-info)))))
    
    1096
    +             (when user-info
    
    1097
    +               (unix:user-info-dir user-info)))))
    
    1094 1098
         (if username
    
    1095 1099
     	(unix-user-homedir username)
    
    1096 1100
     	(let ((env-home (unix:unix-getenv "HOME")))
    

  • src/code/unix.lisp
    ... ... @@ -2644,37 +2644,6 @@
    2644 2644
                :shell (string (cast (slot result 'pw-shell) c-call:c-string)))
    
    2645 2645
     	  (values nil returned)))))
    
    2646 2646
     
    
    2647
    -#+linux
    
    2648
    -(defun unix-getpwnam-tmp (login)
    
    2649
    -  "Return a USER-INFO structure for the user identified by LOGIN, or NIL if not found."
    
    2650
    -  (declare (type simple-string login))
    
    2651
    -  (with-alien ((buf (array c-call:char 1024))
    
    2652
    -	       (user-info (struct passwd))
    
    2653
    -               (result (* (struct passwd))))
    
    2654
    -    (let ((returned
    
    2655
    -	   (alien-funcall
    
    2656
    -	    (extern-alien "getpwnam_r"
    
    2657
    -			  (function c-call:int
    
    2658
    -                                    c-call:c-string
    
    2659
    -                                    (* (struct passwd))
    
    2660
    -				    (* c-call:char)
    
    2661
    -                                    c-call:unsigned-int
    
    2662
    -                                    (* (* (struct passwd)))))
    
    2663
    -	    login
    
    2664
    -	    (addr user-info)
    
    2665
    -	    (cast buf (* c-call:char))
    
    2666
    -	    1024
    
    2667
    -            (addr result))))
    
    2668
    -      (when (zerop returned)
    
    2669
    -        (make-user-info
    
    2670
    -         :name (string (cast (slot result 'pw-name) c-call:c-string))
    
    2671
    -         :password (string (cast (slot result 'pw-passwd) c-call:c-string))
    
    2672
    -         :uid (slot result 'pw-uid)
    
    2673
    -         :gid (slot result 'pw-gid)
    
    2674
    -         :gecos (string (cast (slot result 'pw-gecos) c-call:c-string))
    
    2675
    -         :dir (string (cast (slot result 'pw-dir) c-call:c-string))
    
    2676
    -         :shell (string (cast (slot result 'pw-shell) c-call:c-string)))))))
    
    2677
    -
    
    2678 2647
     ;;; Getrusage is not provided in the C library on Solaris 2.4, and is
    
    2679 2648
     ;;; rather slow on later versions so the "times" system call is
    
    2680 2649
     ;;; provided.
    

  • src/i18n/locale/cmucl.pot
    ... ... @@ -10120,6 +10120,12 @@ msgid ""
    10120 10120
     "optionally keeping some of the most recent old versions."
    
    10121 10121
     msgstr ""
    
    10122 10122
     
    
    10123
    +#: src/code/filesys.lisp
    
    10124
    +msgid ""
    
    10125
    +"Returns the namestring for the user's home directory.  If Username is\n"
    
    10126
    +"  not specified, then use the current user."
    
    10127
    +msgstr ""
    
    10128
    +
    
    10123 10129
     #: src/code/filesys.lisp
    
    10124 10130
     msgid ""
    
    10125 10131
     "Returns the home directory of the logged in user as a pathname.\n"
    
    ... ... @@ -21329,6 +21335,10 @@ msgstr ""
    21329 21335
     msgid "Implements FILE-POSITION for the stream for setting the position."
    
    21330 21336
     msgstr ""
    
    21331 21337
     
    
    21338
    +#: src/pcl/gray-streams.lisp
    
    21339
    +msgid "Implements FILE-LENGTH for the stream."
    
    21340
    +msgstr ""
    
    21341
    +
    
    21332 21342
     #: src/pcl/gray-streams.lisp
    
    21333 21343
     msgid ""
    
    21334 21344
     "Used by READ-BYTE; returns either an integer, or the symbol :EOF\n"