unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* lisp/usr/url-history bug in cvs head
@ 2005-02-20  8:10 James Cloos
  0 siblings, 0 replies; only message in thread
From: James Cloos @ 2005-02-20  8:10 UTC (permalink / raw)


I'm running cvs head updated w/in the last 8 hours.

I've been getting backtraces whenever gnus tries to display an html
mail which tries to dl stuff such as images.

The root cause is is url/url-history.el:

First it has:

|> (defvar url-history-hash-table nil
|>   "Hash table for global history completion.")

then, later, 

|> (defun url-have-visited-url (url)
|>   (url-do-setup)
|>   (gethash url url-history-hash-table nil))

whereas the next defun includes this snippet:

|> (defun url-completion-function (string predicate function)
|>   (url-do-setup)
|> ;;; ...
|>    ((eq function 'lambda)
|>     (and url-history-hash-table
|> 	 (gethash string url-history-hash-table)
|> 	 t))

As you can see, url-completion-function confirms that
url-history-hash-table is non-null before calling gethash.
Both functions also call (url-do-setup), so that cannot
be presumed to set url-history-hash-table.

I presume that url-have-visited-url should use (and) as well.
If so, the patch below adds that call.


diff -uNr emacs/lisp/url/url-history.el url-fix/lisp/url/url-history.el
--- a/lisp/url/url-history.el	2004-10-10 16:37:43.000000000 -0400
+++ b/lisp/url/url-history.el	2005-02-20 03:06:19.388079195 -0500
@@ -164,7 +164,8 @@
 
 (defun url-have-visited-url (url)
   (url-do-setup)
-  (gethash url url-history-hash-table nil))
+  (and url-history-hash-table
+       (gethash url url-history-hash-table nil)))
 
 (defun url-completion-function (string predicate function)
   (url-do-setup)


-JimC
-- 
James H. Cloos, Jr. <cloos@jhcloos.com>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-02-20  8:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-20  8:10 lisp/usr/url-history bug in cvs head James Cloos

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).