From 7ddeecf637983993eda02740660f2e389040571a Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Tue, 13 Dec 2022 01:35:21 -0500 Subject: more extraction --- emacsconf-subed.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'emacsconf-subed.el') diff --git a/emacsconf-subed.el b/emacsconf-subed.el index ec02a9d..250f707 100644 --- a/emacsconf-subed.el +++ b/emacsconf-subed.el @@ -68,7 +68,7 @@ TYPE can be 'end if you want the match end instead of the beginning." (let (pos (found (string-match regexp string after)) result) (while (and found (< found before)) (setq result (if (eq type 'end) (match-end 0) (match-beginning 0))) - (if (string-match regexp string (1+ found)) + (if (and (< found (length string)) (string-match regexp string (1+ found))) (setq found (match-end 0)) (setq found nil))) result)) -- cgit v1.2.3