[FriBidi-commit] fribidi2/lib fribidi-bidi.c,1.20,1.21

Behdad Esfahbod behdad at kemper.freedesktop.org
Thu Mar 15 11:09:27 PDT 2007


Update of /cvs/fribidi/fribidi2/lib
In directory kemper:/tmp/cvs-serv23612

Modified Files:
	fribidi-bidi.c 
Log Message:
Skip explicits-list reinsertion if list is empty.


Index: fribidi-bidi.c
===================================================================
RCS file: /cvs/fribidi/fribidi2/lib/fribidi-bidi.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- fribidi-bidi.c	31 Jan 2006 03:23:13 -0000	1.20
+++ fribidi-bidi.c	15 Mar 2007 18:09:25 -0000	1.21
@@ -720,20 +720,24 @@
 /* Reinsert the explicit codes & BN's that are already removed, from the
    explicits_list to main_run_list. */
   DBG ("reinserting explicit codes");
-  {
-    register FriBidiRun *p;
-    register fribidi_boolean stat =
-      shadow_run_list (main_run_list, explicits_list, true);
-    explicits_list = NULL;
-    if UNLIKELY
-      (!stat) goto out;
+  if UNLIKELY
+    (explicits_list->next != explicits_list)
+    {
+      register FriBidiRun *p;
+      register fribidi_boolean stat =
+	shadow_run_list (main_run_list, explicits_list, true);
+      explicits_list = NULL;
+      if UNLIKELY
+	(!stat) goto out;
 
-    p = main_run_list->next;
-    if (p != main_run_list && p->level == FRIBIDI_SENTINEL)
-      p->level = base_level;
-    for_run_list (p, main_run_list) if (p->level == FRIBIDI_SENTINEL)
-      p->level = p->prev->level;
-  }
+      /* Set level of inserted explicit chars to that of their previous
+       * char, such that they do not affect reordering. */
+      p = main_run_list->next;
+      if (p != main_run_list && p->level == FRIBIDI_SENTINEL)
+	p->level = base_level;
+      for_run_list (p, main_run_list) if (p->level == FRIBIDI_SENTINEL)
+	p->level = p->prev->level;
+    }
 
 # if DEBUG
   if UNLIKELY



More information about the fribidi-commit mailing list