Raymond Toy pushed to branch master at cmucl / cmucl

Commits:

4 changed files:

Changes:

  • src/code/extensions.lisp
    ... ... @@ -676,7 +676,7 @@
    676 676
       subdirectories. Dirname must be a pathname to a directory.  Any NAME
    
    677 677
       or TYPE components in Dirname are ignored."
    
    678 678
       (declare (type pathname dirname))
    
    679
    -  (when recusive
    
    679
    +  (when recursive
    
    680 680
         ;; Find all the files or directories in DIRNAME.
    
    681 681
         (dolist (path (directory (merge-pathnames "*.*" dirname)))
    
    682 682
           ;; If the path is a directory, recursively delete the directory.
    

  • src/code/unix.lisp
    ... ... @@ -2564,5 +2564,5 @@
    2564 2564
     		  (cast result c-call:c-string)
    
    2565 2565
     		  nil)
    
    2566 2566
     	      status))
    
    2567
    -	(free-alien name)))))
    
    2567
    +	(free-alien result)))))
    
    2568 2568
         

  • tests/pathname.lisp
    ... ... @@ -142,3 +142,16 @@
    142 142
                                                   "/*.*")
    
    143 143
                                      :truenamep nil :follow-links nil)))
    
    144 144
           (assert-equal dir-tilde dir-home))))
    
    145
    +
    
    146
    +(define-test delete-directory
    
    147
    +  (let ((dir (ensure-directories-exist "tmp/a/b/c/")))
    
    148
    +    ;; Verify that the directories were created.
    
    149
    +    (assert-equal "tmp/a/b/c/"
    
    150
    +		  dir)
    
    151
    +    ;; Try to delete the directory.  It should fail, which we verify
    
    152
    +    ;; by noting the directory listing is not empty.
    
    153
    +    (ext::delete-directory (pathname "tmp/"))
    
    154
    +    (assert-true (directory "tmp/"))
    
    155
    +    ;; Now recursively delete the directory.
    
    156
    +    (ext::delete-directory (pathname "tmp/") :recursive t)
    
    157
    +    (assert-false (directory "tmp/"))))

  • tests/unix.lisp
    ... ... @@ -88,4 +88,7 @@
    88 88
         (assert-false result)
    
    89 89
         (assert-true (and (integerp errno) (plusp errno)))))
    
    90 90
     
    
    91
    -
    91
    +(define-test unix-get-username
    
    92
    +  (let ((uid (unix:unix-getuid)))
    
    93
    +    (assert-true uid)
    
    94
    +    (assert-true (unix::unix-get-username uid))))