changeset 105045:92f324954126

(what-page): Make sure we don't inf-loop if page-delimiter matches the empty string.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 16 Sep 2009 13:15:10 +0000
parents 2e1ecbf638ee
children c0cf67a653c9
files lisp/ChangeLog lisp/textmodes/page.el
diffstat 2 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Wed Sep 16 03:13:55 2009 +0000
+++ b/lisp/ChangeLog	Wed Sep 16 13:15:10 2009 +0000
@@ -1,3 +1,8 @@
+2009-09-16  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* textmodes/page.el (what-page): Make sure we don't inf-loop if
+	page-delimiter matches the empty string.
+
 2009-09-16  Glenn Morris  <rgm@gnu.org>
 
 	* emacs-lisp/bytecomp.el (byte-compile-not-obsolete-vars): Rename from
--- a/lisp/textmodes/page.el	Wed Sep 16 03:13:55 2009 +0000
+++ b/lisp/textmodes/page.el	Wed Sep 16 13:15:10 2009 +0000
@@ -153,6 +153,8 @@
 	    (opoint (point)))
 	(goto-char (point-min))
 	(while (re-search-forward page-delimiter opoint t)
+          (if (= (match-beginning 0) (match-end 0))
+              (forward-char 1))
 	  (setq count (1+ count)))
 	(message "Page %d, line %d"
 		 count