Commit 48494e06 authored by Lars Magne Ingebrigtsen's avatar Lars Magne Ingebrigtsen
Browse files

(shr-make-table-1): Ensure that we don't infloop on degenerate widths.

parent aec7da77
2013-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
* net/shr.el (shr-make-table-1): Ensure that we don't infloop on
degenerate widths.
2013-07-19 Richard Stallman <rms@gnu.org> 2013-07-19 Richard Stallman <rms@gnu.org>
* epa.el (epa-popup-info-window): Doc fix. * epa.el (epa-popup-info-window): Doc fix.
......
...@@ -1476,9 +1476,6 @@ ones, in case fg and bg are nil." ...@@ -1476,9 +1476,6 @@ ones, in case fg and bg are nil."
(if column (if column
(aref widths width-column) (aref widths width-column)
10)) 10))
;; Sanity check for degenerate tables.
(when (zerop width)
(setq width 10))
(when (and fill (when (and fill
(setq colspan (cdr (assq :colspan (cdr column))))) (setq colspan (cdr (assq :colspan (cdr column)))))
(setq colspan (string-to-number colspan)) (setq colspan (string-to-number colspan))
...@@ -1491,6 +1488,9 @@ ones, in case fg and bg are nil." ...@@ -1491,6 +1488,9 @@ ones, in case fg and bg are nil."
(setq width-column (+ width-column (1- colspan)))) (setq width-column (+ width-column (1- colspan))))
(when (or column (when (or column
(not fill)) (not fill))
;; Sanity check for degenerate tables.
(when (zerop width)
(setq width 10))
(push (shr-render-td (cdr column) width fill) (push (shr-render-td (cdr column) width fill)
tds)) tds))
(setq i (1+ i) (setq i (1+ i)
...@@ -1499,6 +1499,7 @@ ones, in case fg and bg are nil." ...@@ -1499,6 +1499,7 @@ ones, in case fg and bg are nil."
(nreverse trs))) (nreverse trs)))
(defun shr-render-td (cont width fill) (defun shr-render-td (cont width fill)
(when (= width 0) (debug))
(with-temp-buffer (with-temp-buffer
(let ((bgcolor (cdr (assq :bgcolor cont))) (let ((bgcolor (cdr (assq :bgcolor cont)))
(fgcolor (cdr (assq :fgcolor cont))) (fgcolor (cdr (assq :fgcolor cont)))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment