summaryrefslogtreecommitdiffstats
path: root/emacsconf-subed.el
diff options
context:
space:
mode:
Diffstat (limited to 'emacsconf-subed.el')
-rw-r--r--emacsconf-subed.el2
1 files changed, 1 insertions, 1 deletions
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))