Raymond Toy pushed to branch master at cmucl / cmucl

Commits:

2 changed files:

Changes:

  • src/code/filesys.lisp
    ... ... @@ -721,7 +721,7 @@
    721 721
     				   verify-existence follow-links
    
    722 722
     				   nil function))
    
    723 723
     	  (:relative
    
    724
    -	   (%enumerate-directories "" (cdr directory) pathname
    
    724
    +	   (%enumerate-directories "./" (cdr directory) pathname
    
    725 725
     				   verify-existence follow-links
    
    726 726
     				   nil function)))
    
    727 727
     	(%enumerate-files "" pathname verify-existence function))))
    
    ... ... @@ -1110,11 +1110,6 @@ optionally keeping some of the most recent old versions."
    1110 1110
     		 :pathname file
    
    1111 1111
     		 :format-control (intl:gettext "~S doesn't exist.")
    
    1112 1112
     		 :format-arguments (list file)))
    
    1113
    -	;; unix-namestring converts "." to "".  Convert it back to
    
    1114
    -	;; "." so we can stat the current directory.  (Perhaps
    
    1115
    -	;; that's a bug in unix-namestring?)
    
    1116
    -	(when (zerop (length name))
    
    1117
    -	  (setf name "."))
    
    1118 1113
     	(let (author)
    
    1119 1114
     	  (unwind-protect
    
    1120 1115
     	       (progn
    

  • tests/issues.lisp
    ... ... @@ -707,6 +707,33 @@
    707 707
     		  ".txt")
    
    708 708
          *test-path*))))
    
    709 709
     
    
    710
    +(define-test issue.135
    
    711
    +    (:tag :issues)
    
    712
    +  (assert-equalp "./" (ext:unix-namestring "."))
    
    713
    +  (unwind-protect
    
    714
    +       (progn
    
    715
    +	 ;; Create a test file in the current directory.
    
    716
    +	 ;; unix-namestring requires files to exist to be able to
    
    717
    +	 ;; return the namestring.
    
    718
    +	 (with-open-file (f1 "foo.txt"
    
    719
    +			     :direction :output
    
    720
    +			     :if-exists :supersede)
    
    721
    +	   (print "foo" f1))
    
    722
    +	 ;; Check unix-namestring and verify that converting the
    
    723
    +	 ;; namestring to a pathname results in the same pathname
    
    724
    +	 ;; object as expected.
    
    725
    +	 (let ((foo (ext:unix-namestring "foo.txt")))
    
    726
    +	   (assert-equalp "foo.txt" foo)
    
    727
    +	   (assert-equalp (make-pathname :name "foo" :type "txt")
    
    728
    +			  (pathname foo)))
    
    729
    +	 (let ((bar (ext:unix-namestring "src/code/filesys.lisp")))
    
    730
    +	   (assert-equalp "./src/code/filesys.lisp" bar)
    
    731
    +	   (assert-equalp (make-pathname :directory '(:relative "src" "code")
    
    732
    +					 :name "filesys"
    
    733
    +					 :type "lisp")
    
    734
    +			  (pathname bar))))
    
    735
    +    (assert-true (delete-file "foo.txt"))))
    
    736
    +
    
    710 737
     (define-test issue.139-default-external-format
    
    711 738
         (:tag :issues)
    
    712 739
       (assert-eq :utf-8 stream:*default-external-format*)