Raymond Toy pushed to branch master at cmucl / cmucl

Commits:

2 changed files:

Changes:

  • src/code/pathname.lisp
    ... ... @@ -496,14 +496,22 @@
    496 496
     	(cons
    
    497 497
     	 (and (consp that)
    
    498 498
     	      (compare-component (car this) (car that))
    
    499
    -	      (compare-component (cdr this) (cdr that)))))))
    
    499
    +	      (compare-component (cdr this) (cdr that))))
    
    500
    +	(symbol
    
    501
    +	 ;; Handle NIL and :UNSPECIFIC as being equivalent
    
    502
    +	 (or (and (eq this :unspecific)
    
    503
    +		  (null that))
    
    504
    +	     (and (null this)
    
    505
    +		  (eq that :unspecific)))))))
    
    500 506
     
    
    501 507
     ;; Compare the version component.  We treat NIL to be EQUAL to
    
    502
    -;; :NEWEST.
    
    508
    +;; :NEWEST or :UNSPECIFIC.
    
    503 509
     (defun compare-version-component (this that)
    
    504 510
       (or (eql this that)
    
    505
    -      (and (null this) (eq that :newest))
    
    506
    -      (and (null that) (eq this :newest))))
    
    511
    +      (if (and (member this '(nil :newest :unspecific) :test #'eq)
    
    512
    +	       (member that '(nil :newest :unspecific) :test #'eq))
    
    513
    +	  t
    
    514
    +	  nil)))
    
    507 515
     
    
    508 516
     ;;;; Pathname functions.
    
    509 517
     
    

  • tests/issues.lisp
    ... ... @@ -944,3 +944,36 @@
    944 944
         (assert-true (typep idf-max-expo 'kernel:double-float-int-exponent))
    
    945 945
         (assert-true (typep (1- idf-max-expo) 'kernel:double-float-int-exponent))
    
    946 946
         (assert-false (typep (1+ idf-max-expo) 'kernel:double-float-int-exponent))))
    
    947
    +
    
    948
    +(define-test issue.192.device
    
    949
    +  (assert-true (equal (make-pathname :device :unspecific)
    
    950
    +		      (make-pathname :device nil)))
    
    951
    +  (assert-true (equal (make-pathname :device nil)
    
    952
    +		      (make-pathname :device :unspecific))))
    
    953
    +
    
    954
    +(define-test issue.192.name
    
    955
    +  (assert-true (equal (make-pathname :name :unspecific)
    
    956
    +		      (make-pathname :name nil)))
    
    957
    +  (assert-true (equal (make-pathname :name nil)
    
    958
    +		      (make-pathname :name :unspecific))))
    
    959
    +
    
    960
    +(define-test issue.192.type
    
    961
    +  (assert-true (equal (make-pathname :type :unspecific)
    
    962
    +		      (make-pathname :type nil)))
    
    963
    +  (assert-true (equal (make-pathname :type nil)
    
    964
    +		      (make-pathname :type :unspecific))))
    
    965
    +
    
    966
    +(define-test issue.192.version
    
    967
    +  (assert-true (equal (make-pathname :version :newest)
    
    968
    +		      (make-pathname :version nil)))
    
    969
    +  (assert-true (equal (make-pathname :version nil)
    
    970
    +		      (make-pathname :version :newest)))
    
    971
    +  (assert-true (equal (make-pathname :version :unspecific)
    
    972
    +		      (make-pathname :version nil)))
    
    973
    +  (assert-true (equal (make-pathname :version nil)
    
    974
    +		      (make-pathname :version :unspecific)))
    
    975
    +  (assert-true (equal (make-pathname :version :unspecific)
    
    976
    +		      (make-pathname :version :newest)))
    
    977
    +  (assert-true (equal (make-pathname :version :newest)
    
    978
    +		      (make-pathname :version :unspecific)))
    
    979
    +)