From 35e91dcfd2f2a299b3d26726cd59760df36ad4d3 Mon Sep 17 00:00:00 2001 From: jaortega Date: Fri, 15 Feb 2008 23:33:10 +0000 Subject: [PATCH] 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). --- scsh/rx/re-low.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scsh/rx/re-low.scm b/scsh/rx/re-low.scm index 37f1508..ab47d2f 100644 --- a/scsh/rx/re-low.scm +++ b/scsh/rx/re-low.scm @@ -81,7 +81,7 @@ (let ((ret (regexp-match (cre:regexp cre) str #t #f #f start))) (if (not ret) #f - (make-regexp-match str + (make-regexp-match str (translate-submatches ret (cre:tvec cre) match-vec)))))))) @@ -114,4 +114,4 @@ (if (not (cre:regexp/nm cre)) (set-cre:regexp/nm cre (make-regexp re-str (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)))))