Fix bug in bos/eos handling.

CRE-SEARCH? (defined in scsh/rx/re-low.scm) calls REGEXP-MATCH with
4th and 5th arguments indicating whether this corresponds to begin/end
of line. For matching a string, these must be #t. The reason it was
working previously (with both parameters set to #f) was a bug in
regexp1.c:116 (fixed now by placing the appropriate parenthesis),
caused by | having higher precedence than ?: in C (as a result, the
flags passed to the C regexp engine were not correctly computed).
This commit is contained in:
jaortega 2008-02-15 23:33:10 +00:00
parent b0d75bda86
commit 35e91dcfd2
1 changed files with 2 additions and 2 deletions

View File

@ -81,7 +81,7 @@
(let ((ret (regexp-match (cre:regexp cre) str #t #f #f start))) (let ((ret (regexp-match (cre:regexp cre) str #t #f #f start)))
(if (not ret) (if (not ret)
#f #f
(make-regexp-match str (make-regexp-match str
(translate-submatches ret (translate-submatches ret
(cre:tvec cre) (cre:tvec cre)
match-vec)))))))) match-vec))))))))
@ -114,4 +114,4 @@
(if (not (cre:regexp/nm cre)) (if (not (cre:regexp/nm cre))
(set-cre:regexp/nm cre (make-regexp re-str (set-cre:regexp/nm cre (make-regexp re-str
(regexp-option extended)))) (regexp-option extended))))
(regexp-match (cre:regexp/nm cre) str #f #f #f start))))) (regexp-match (cre:regexp/nm cre) str #f #t #t start)))))