summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2013-01-04 19:47:24 -0600
committerBehdad Esfahbod <behdad@behdad.org>2013-01-04 19:47:24 -0600
commitfae80c8290b8bb1f1a11e429a47e80248eaf3072 (patch)
tree6b4b132f6813af352a588ad0a01abd6f6acf19bb
parent1cca32b775123f8f7bd5a2d4b3380e8d5bee13b0 (diff)
Fix bug with rule W5
Test case added. This was discovered by running against the Unicode test suite. https://github.com/behdad/fribidi-vs-unicode
-rw-r--r--lib/fribidi-bidi.c6
-rw-r--r--test/test_CapRTL_implicit.input1
-rw-r--r--test/test_CapRTL_implicit.reference1
3 files changed, 7 insertions, 1 deletions
diff --git a/lib/fribidi-bidi.c b/lib/fribidi-bidi.c
index 42a5fab..6e67d57 100644
--- a/lib/fribidi-bidi.c
+++ b/lib/fribidi-bidi.c
@@ -546,6 +546,10 @@ fribidi_get_par_embedding_levels (
pp = merge_with_prev (pp);
else
RL_TYPE (pp) = prev_type;
+ if (prev_type == next_type && RL_LEVEL (pp) == RL_LEVEL (pp->next))
+ {
+ pp = merge_with_prev (pp->next);
+ }
continue; /* As we know the next condition cannot be true. */
}
@@ -564,7 +568,7 @@ fribidi_get_par_embedding_levels (
last_strong = base_dir;
/* Resolving dependency of loops for rules W4 and W5, W5 may
- want to prevent W4 to take effect in the next turn, do this
+ want to prevent W4 to take effect in the next turn, do this
through "w4". */
w4 = true;
/* Resolving dependency of loops for rules W4 and W5 with W7,
diff --git a/test/test_CapRTL_implicit.input b/test/test_CapRTL_implicit.input
index cd5fadf..ef6a3d5 100644
--- a/test/test_CapRTL_implicit.input
+++ b/test/test_CapRTL_implicit.input
@@ -24,3 +24,4 @@ A TEST FOR WEAK TYPES: 123+,456
ANOTHER FOR WEAK TYPES: A123,456
MORE WEAK TYPES: hooloo123,456
and TEST|L1 ||too
+_<+`+1
diff --git a/test/test_CapRTL_implicit.reference b/test/test_CapRTL_implicit.reference
index 6ef244a..e324a7e 100644
--- a/test/test_CapRTL_implicit.reference
+++ b/test/test_CapRTL_implicit.reference
@@ -24,3 +24,4 @@ A TEST FOR WEAK TYPES: 123+,456 => 456,123+ :SEPYT KAEW ROF TSET A
ANOTHER FOR WEAK TYPES: A123,456 => 123,456A :SEPYT KAEW ROF REHTONA
MORE WEAK TYPES: hooloo123,456 => hooloo123,456 :SEPYT KAEW EROM
and TEST|L1 ||too => and TSET|1L ||too
+_<+`+1 => +`+1