changeset 73374:959e3f79c94d

* woman.el (woman2-format-paragraphs): Avoid infinite loop in case there is no terminating newline.
author Chong Yidong <cyd@stupidchicken.com>
date Sun, 15 Oct 2006 19:13:44 +0000
parents 052270c7f73d
children 7f5141d05971
files lisp/woman.el
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/woman.el	Sun Oct 15 04:19:49 2006 +0000
+++ b/lisp/woman.el	Sun Oct 15 19:13:44 2006 +0000
@@ -4121,7 +4121,11 @@
 	       (eolp)
 	       (skip-syntax-forward " ")
 	       (setq woman-leave-blank-lines 1))
-	  (beginning-of-line)
+	  ;; This shouldn't happen, but in case it does (e.g. for
+	  ;; badly-formatted manfiles with no terminating newline),
+	  ;; avoid an infinite loop.
+	  (unless (and (eolp) (eobp))
+	    (beginning-of-line))
 	  ;; If a single short line then just leave it.
 	  ;; This is necessary to preserve some table layouts.
 	  ;; PROBABLY NOT NECESSARY WITH SQUEEZE MODIFICATION !!!!!