changeset 111902:3d34c0b303ff

* url-cookie.el (url-cookie-retrieve): Handle null LOCALPART (Bug#7543). Suggested by Lennart Borgman.
author Chong Yidong <cyd@stupidchicken.com>
date Sat, 04 Dec 2010 17:41:41 -0500
parents 4bb97b6fa4d3
children d567b4182a1a
files lisp/url/ChangeLog lisp/url/url-cookie.el
diffstat 2 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/url/ChangeLog	Sat Dec 04 16:45:17 2010 -0500
+++ b/lisp/url/ChangeLog	Sat Dec 04 17:41:41 2010 -0500
@@ -1,3 +1,8 @@
+2010-12-04  Chong Yidong  <cyd@stupidchicken.com>
+
+	* url-cookie.el (url-cookie-retrieve): Handle null LOCALPART.
+	Suggested by Lennart Borgman (Bug#7543).
+
 2010-09-18  Glenn Morris  <rgm@gnu.org>
 
 	* url-cache.el (url-is-cached): Doc fix.
--- a/lisp/url/url-cookie.el	Sat Dec 04 16:45:17 2010 -0500
+++ b/lisp/url/url-cookie.el	Sat Dec 04 17:41:41 2010 -0500
@@ -198,7 +198,7 @@
     (and exp (> (float-time) (float-time (date-to-time exp))))))
 
 (defun url-cookie-retrieve (host &optional localpart secure)
-  "Retrieve all the netscape-style cookies for a specified HOST and LOCALPART."
+  "Retrieve all cookies for a specified HOST and LOCALPART."
   (let ((storage (if secure
 		     (append url-cookie-secure-storage url-cookie-storage)
 		   url-cookie-storage))
@@ -226,7 +226,8 @@
 	    (setq cur (car cookies)
 		  cookies (cdr cookies)
 		  localpart-match (url-cookie-localpart cur))
-	    (if (and (if (stringp localpart-match)
+	    (if (and (if (and (stringp localpart-match)
+			      (stringp localpart))
 			 (string-match (concat "^" (regexp-quote
 						    localpart-match))
 				       localpart)