~ chicken-core (chicken-5) b733f9bb85d705395775773b1b52f7d774c92b39


commit b733f9bb85d705395775773b1b52f7d774c92b39
Author:     Peter Bex <Peter.Bex@xs4all.nl>
AuthorDate: Fri Sep 24 22:44:34 2010 +0200
Commit:     Peter Bex <Peter.Bex@xs4all.nl>
CommitDate: Fri Sep 24 22:44:34 2010 +0200

    Apply upstream changeset 2df51ecb1b14 (Fix UTF8 issue caused by calling the STRING procedure on characters, which breaks the string in Chicken)

diff --git a/irregex-core.scm b/irregex-core.scm
index 6b2ae25a..f09ab23c 100644
--- a/irregex-core.scm
+++ b/irregex-core.scm
@@ -3611,7 +3611,9 @@
              (lp (sre-alternate (cdr sre)) #t))
             (else
              (%irregex-error "not a valid sre char-set operator" sre)))))
-     ((char? sre) (rec (list (string sre))))
+     ((char? sre) (if ci?
+                      (cset-case-insensitive (range->cset sre sre))
+                      (range->cset sre sre)))
      ((string? sre) (rec (list sre)))
      (else
       (let ((cell (assq sre sre-named-definitions)))
diff --git a/tests/test-irregex.scm b/tests/test-irregex.scm
index 917e6e6a..8697a24f 100644
--- a/tests/test-irregex.scm
+++ b/tests/test-irregex.scm
@@ -443,9 +443,7 @@
 (test-assert (irregex-search "(?u:<[あ-ん]*>)" "<あん>"))
 (test-assert (irregex-search "(?u:<[あ-ん]*>)" "<ひらがな>"))
 (test-assert (not (irregex-search "(?u:<[あ-ん]*>)" "<ひらgがな>")))
+(test-assert (not (irregex-search "(?u:<[^あ-ん語]*>)" "<語>")))
 
-(test-end)
-
-
-(test-exit)
+(test-end)(test-exit)
 
Trap