[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] dfa: fix single byte character ranges
From: |
Paolo Bonzini |
Subject: |
[PATCH] dfa: fix single byte character ranges |
Date: |
Thu, 25 Mar 2010 13:13:26 +0100 |
* src/dfa.c (in_coll_range): Fix ordering for second strcoll. Reported
by Dmitry V. Levin.
* tests/spencer1-locale.awk: Also test single-byte character sets.
* THANKS: Add Dmitry.
---
Rather than adding a specific testcase, I added more locales
to the spencer1-locale test.
THANKS | 1 +
src/dfa.c | 2 +-
tests/spencer1-locale.awk | 2 ++
3 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/THANKS b/THANKS
index 64f24f1..db792e6 100644
--- a/THANKS
+++ b/THANKS
@@ -21,6 +21,7 @@ Dagobert Michelsen <address@hidden>
David Clissold <address@hidden>
David J MacKenzie <address@hidden>
David O'Brien <address@hidden>
+Dmitry V. Levin <address@hidden>
Eli Zaretskii <address@hidden>
Eric Blake <address@hidden>
Florian La Roche <address@hidden>
diff --git a/src/dfa.c b/src/dfa.c
index e2e45fd..7905bfb 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -397,7 +397,7 @@ static int
in_coll_range (char ch, char from, char to)
{
char c[6] = { from, 0, ch, 0, to, 0 };
- return strcoll (&c[0], &c[2]) <= 0 && 0 <= strcoll (&c[2], &c[4]);
+ return strcoll (&c[0], &c[2]) <= 0 && strcoll (&c[2], &c[4]) <= 0;
}
static int is_alpha(int c) { return ISALPHA(c); }
diff --git a/tests/spencer1-locale.awk b/tests/spencer1-locale.awk
index b22de30..ff89342 100644
--- a/tests/spencer1-locale.awk
+++ b/tests/spencer1-locale.awk
@@ -12,6 +12,8 @@ BEGIN {
$0 !~ /^#/ && NF == 3 {
test("en_US.UTF-8")
+ test("ru_RU.KOI8-R")
+ test("fr_FR.ISO-8859-1")
test("zh_CN")
if (extra_locale != "") {
test(extra_locale)
--
1.6.6.1