# HG changeset patch # User Aidan Kehoe # Date 1257087946 0 # Node ID d0ea57eb3de4b0a50f131281e09dcb4ec283101e # Parent 90dbf8e772b64d2cb8432e577875eeeb91055ec8 Don't error if handed a string and a non-string, #'equalp. tests/ChangeLog addition: 2009-11-01 Aidan Kehoe * automated/lisp-tests.el: Check that (equal "hi there" [hi there]) gives nil, instead of erroring; fixes a bug Ben introduced in 2002. lisp/ChangeLog addition: 2009-11-01 Aidan Kehoe * cl-extra.el (equalp): Don't error if handed a string and a non-string. diff -r 90dbf8e772b6 -r d0ea57eb3de4 lisp/ChangeLog --- a/lisp/ChangeLog Sun Nov 01 20:21:11 2009 +0900 +++ b/lisp/ChangeLog Sun Nov 01 15:05:46 2009 +0000 @@ -1,3 +1,8 @@ +2009-11-01 Aidan Kehoe + + * cl-extra.el (equalp): + Don't error if handed a string and a non-string. + 2009-11-01 Stephen Turnbull * font.el (font-combine-fonts-internal): diff -r 90dbf8e772b6 -r d0ea57eb3de4 lisp/cl-extra.el --- a/lisp/cl-extra.el Sun Nov 01 20:21:11 2009 +0900 +++ b/lisp/cl-extra.el Sun Nov 01 15:05:46 2009 +0000 @@ -97,7 +97,8 @@ (cond ((eq x y) t) ((stringp x) ;; XEmacs change: avoid downcase - (eq t (compare-strings x nil nil y nil nil t))) + (and (stringp y) + (eq t (compare-strings x nil nil y nil nil t)))) ;; XEmacs addition: compare characters ((characterp x) (and (characterp y) diff -r 90dbf8e772b6 -r d0ea57eb3de4 tests/ChangeLog --- a/tests/ChangeLog Sun Nov 01 20:21:11 2009 +0900 +++ b/tests/ChangeLog Sun Nov 01 15:05:46 2009 +0000 @@ -1,3 +1,9 @@ +2009-11-01 Aidan Kehoe + + * automated/lisp-tests.el: + Check that (equal "hi there" [hi there]) gives nil, instead of + erroring; fixes a bug Ben introduced in 2002. + 2009-10-12 Aidan Kehoe * automated/mule-tests.el : diff -r 90dbf8e772b6 -r d0ea57eb3de4 tests/automated/lisp-tests.el --- a/tests/automated/lisp-tests.el Sun Nov 01 20:21:11 2009 +0900 +++ b/tests/automated/lisp-tests.el Sun Nov 01 15:05:46 2009 +0000 @@ -2091,3 +2091,6 @@ (letf (((values three one-four-one-five-nine) (floor pi))) (* three one-four-one-five-nine)))) +;; This used to error: +(Assert (nil (equalp "hi there" [hi there])) + "checking equalp doesn't error with string and non-string")