From: Lars Magne Ingebrigtsen Date: Fri, 19 Jul 2013 14:07:43 +0000 (+0200) Subject: (shr-make-table-1): Ensure that we don't infloop on degenerate widths. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~1759^2~8 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=48494e063ab31b60c1079c016ad4256a071afeae;p=emacs.git (shr-make-table-1): Ensure that we don't infloop on degenerate widths. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b78d5587e46..d583d7f9063 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-07-19 Lars Magne Ingebrigtsen + + * net/shr.el (shr-make-table-1): Ensure that we don't infloop on + degenerate widths. + 2013-07-19 Richard Stallman * epa.el (epa-popup-info-window): Doc fix. diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 4506ede8722..83f7596f34f 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -1476,9 +1476,6 @@ ones, in case fg and bg are nil." (if column (aref widths width-column) 10)) - ;; Sanity check for degenerate tables. - (when (zerop width) - (setq width 10)) (when (and fill (setq colspan (cdr (assq :colspan (cdr column))))) (setq colspan (string-to-number colspan)) @@ -1491,6 +1488,9 @@ ones, in case fg and bg are nil." (setq width-column (+ width-column (1- colspan)))) (when (or column (not fill)) + ;; Sanity check for degenerate tables. + (when (zerop width) + (setq width 10)) (push (shr-render-td (cdr column) width fill) tds)) (setq i (1+ i) @@ -1499,6 +1499,7 @@ ones, in case fg and bg are nil." (nreverse trs))) (defun shr-render-td (cont width fill) + (when (= width 0) (debug)) (with-temp-buffer (let ((bgcolor (cdr (assq :bgcolor cont))) (fgcolor (cdr (assq :fgcolor cont)))