From: Lars Magne Ingebrigtsen Date: Sat, 25 Feb 2012 13:20:57 +0000 (+0000) Subject: shr.el (shr-column-specs): Protect against TDs with "width: 0%". X-Git-Tag: emacs-pretest-24.0.94~18 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5d8522565e8cbd6031a6c6cd4572187193d276b5;p=emacs.git shr.el (shr-column-specs): Protect against TDs with "width: 0%". --- diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index e58b6cc7773..5b9ffc07d1c 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,7 @@ +2012-02-25 Lars Magne Ingebrigtsen + + * shr.el (shr-column-specs): Protect against TDs with "width: 0%". + 2012-02-23 Katsumi Yamaoka * nntp.el (nntp-send-authinfo): Work for secure nntp entry in authinfo. diff --git a/lisp/gnus/shr.el b/lisp/gnus/shr.el index dd0f1599c36..41f12243971 100644 --- a/lisp/gnus/shr.el +++ b/lisp/gnus/shr.el @@ -1364,10 +1364,10 @@ ones, in case fg and bg are nil." (when (memq (car column) '(td th)) (let ((width (cdr (assq :width (cdr column))))) (when (and width - (string-match "\\([0-9]+\\)%" width)) - (aset columns i - (/ (string-to-number (match-string 1 width)) - 100.0)))) + (string-match "\\([0-9]+\\)%" width) + (not (zerop (setq width (string-to-number + (match-string 1 width)))))) + (aset columns i (/ width 100.0)))) (setq i (1+ i))))))) columns))