diff options
| author | Lars Magne Ingebrigtsen | 2013-07-19 16:07:43 +0200 |
|---|---|---|
| committer | Lars Magne Ingebrigtsen | 2013-07-19 16:07:43 +0200 |
| commit | 48494e063ab31b60c1079c016ad4256a071afeae (patch) | |
| tree | 71e778d93cff7f9575dbcaa60af10309e83fbfb2 /lisp | |
| parent | aec7da77ec1033bc23996d6d2d73a0431a7821b3 (diff) | |
| download | emacs-48494e063ab31b60c1079c016ad4256a071afeae.tar.gz emacs-48494e063ab31b60c1079c016ad4256a071afeae.zip | |
(shr-make-table-1): Ensure that we don't infloop on degenerate widths.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/net/shr.el | 7 |
2 files changed, 9 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b78d5587e46..d583d7f9063 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org> | ||
| 2 | |||
| 3 | * net/shr.el (shr-make-table-1): Ensure that we don't infloop on | ||
| 4 | degenerate widths. | ||
| 5 | |||
| 1 | 2013-07-19 Richard Stallman <rms@gnu.org> | 6 | 2013-07-19 Richard Stallman <rms@gnu.org> |
| 2 | 7 | ||
| 3 | * epa.el (epa-popup-info-window): Doc fix. | 8 | * 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." | |||
| 1476 | (if column | 1476 | (if column |
| 1477 | (aref widths width-column) | 1477 | (aref widths width-column) |
| 1478 | 10)) | 1478 | 10)) |
| 1479 | ;; Sanity check for degenerate tables. | ||
| 1480 | (when (zerop width) | ||
| 1481 | (setq width 10)) | ||
| 1482 | (when (and fill | 1479 | (when (and fill |
| 1483 | (setq colspan (cdr (assq :colspan (cdr column))))) | 1480 | (setq colspan (cdr (assq :colspan (cdr column))))) |
| 1484 | (setq colspan (string-to-number colspan)) | 1481 | (setq colspan (string-to-number colspan)) |
| @@ -1491,6 +1488,9 @@ ones, in case fg and bg are nil." | |||
| 1491 | (setq width-column (+ width-column (1- colspan)))) | 1488 | (setq width-column (+ width-column (1- colspan)))) |
| 1492 | (when (or column | 1489 | (when (or column |
| 1493 | (not fill)) | 1490 | (not fill)) |
| 1491 | ;; Sanity check for degenerate tables. | ||
| 1492 | (when (zerop width) | ||
| 1493 | (setq width 10)) | ||
| 1494 | (push (shr-render-td (cdr column) width fill) | 1494 | (push (shr-render-td (cdr column) width fill) |
| 1495 | tds)) | 1495 | tds)) |
| 1496 | (setq i (1+ i) | 1496 | (setq i (1+ i) |
| @@ -1499,6 +1499,7 @@ ones, in case fg and bg are nil." | |||
| 1499 | (nreverse trs))) | 1499 | (nreverse trs))) |
| 1500 | 1500 | ||
| 1501 | (defun shr-render-td (cont width fill) | 1501 | (defun shr-render-td (cont width fill) |
| 1502 | (when (= width 0) (debug)) | ||
| 1502 | (with-temp-buffer | 1503 | (with-temp-buffer |
| 1503 | (let ((bgcolor (cdr (assq :bgcolor cont))) | 1504 | (let ((bgcolor (cdr (assq :bgcolor cont))) |
| 1504 | (fgcolor (cdr (assq :fgcolor cont))) | 1505 | (fgcolor (cdr (assq :fgcolor cont))) |