changeset 20887:bb0f5fde5973

(cookie-snarf): Use match-beginning on the delimiter. (cookie-delimiter): Handle single-% delimiter.
author Richard M. Stallman <rms@gnu.org>
date Thu, 12 Feb 1998 03:10:53 +0000
parents 7aa1fdcd551a
children 98172ad9f511
files lisp/play/cookie1.el
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/play/cookie1.el	Wed Feb 11 07:14:24 1998 +0000
+++ b/lisp/play/cookie1.el	Thu Feb 12 03:10:53 1998 +0000
@@ -57,7 +57,7 @@
 ; Randomize the seed in the random number generator.
 (random t)
 
-(defconst cookie-delimiter "\n%%\n\\|\0"
+(defconst cookie-delimiter "\n%%\n\\|\n%\n\\|\0"
   "Delimiter used to separate cookie file entries.")
 
 (defvar cookie-cache (make-vector 511 0)
@@ -115,7 +115,7 @@
 	  (while (progn (skip-chars-forward " \t\n\r\f") (not (eobp)))
 	    (let ((beg (point)))
 	      (re-search-forward cookie-delimiter)
-	      (setq result (cons (buffer-substring beg (1- (point)))
+	      (setq result (cons (buffer-substring beg (match-beginning 0))
 				 result))))
 	  (kill-buffer buf)
 	  (message "%s" endmsg)