diff lisp/woman.el @ 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 5d2e9706764f
children b2e5081b9320 7eeafaaa9eab
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 !!!!!