diff --git a/code/hash-new.lisp b/code/hash-new.lisp index de9f276b86714b79a0d24b212df6a8ce1936968f..61411e8f9c1cb14913f58bc1da21b6b94fd5001a 100644 --- a/code/hash-new.lisp +++ b/code/hash-new.lisp @@ -5,7 +5,7 @@ ;;; Carnegie Mellon University, and has been placed in the public domain. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/hash-new.lisp,v 1.34 2005/09/26 19:59:55 rtoy Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/hash-new.lisp,v 1.35 2005/09/30 14:53:52 rtoy Exp $") ;;; ;;; ********************************************************************** ;;; @@ -924,7 +924,10 @@ (sxmash hash (internal-sxhash (%pathname-directory s-expr) depth)) (sxmash hash (internal-sxhash (%pathname-name s-expr) depth)) (sxmash hash (internal-sxhash (%pathname-type s-expr) depth)) - (sxmash hash (internal-sxhash (%pathname-version s-expr) depth)))) + ;; Hash :newest the same as NIL because EQUAL for pathnames + ;; assumes that :newest and nil are equal. + (let ((version (%pathname-version s-expr))) + (sxmash hash (internal-sxhash (if (eql version :newest) nil version) depth))))) (instance (if (or (typep s-expr 'structure-object) (typep s-expr 'condition)) diff --git a/code/pathname.lisp b/code/pathname.lisp index 85b184a03b1371d1005ba19983022a67c2574c29..cdc4772ad2f0a6fab75b6c294dc2f4e0c8ef0fd0 100644 --- a/code/pathname.lisp +++ b/code/pathname.lisp @@ -4,7 +4,7 @@ ;;; Carnegie Mellon University, and has been placed in the public domain. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/pathname.lisp,v 1.81 2005/09/27 21:17:02 rtoy Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/pathname.lisp,v 1.82 2005/09/30 14:53:52 rtoy Exp $") ;;; ;;; ********************************************************************** ;;; @@ -423,6 +423,12 @@ (compare-component (car this) (car that)) (compare-component (cdr this) (cdr that))))))) +;; Compare the version component. We treat NIL to be EQUAL to +;; :NEWEST. +(defun compare-version-component (this that) + (or (eql this that) + (and (null this) (eq that :newest)) + (and (null that) (eq this :newest)))) ;;;; Pathname functions. @@ -445,8 +451,8 @@ (%pathname-name pathname2)) (compare-component (%pathname-type pathname1) (%pathname-type pathname2)) - (compare-component (%pathname-version pathname1) - (%pathname-version pathname2)))) + (compare-version-component (%pathname-version pathname1) + (%pathname-version pathname2)))) ;;; WITH-PATHNAME -- Internal ;;; Converts the expr, a pathname designator (a pathname, or string, or