Index: ftxgsub.c
===================================================================
RCS file: /cvs/gnome/pango/pango/opentype/ftxgsub.c,v
retrieving revision 1.15
diff -u -r1.15 ftxgsub.c
--- ftxgsub.c	28 Jul 2003 22:28:37 -0000	1.15
+++ ftxgsub.c	11 Aug 2003 07:59:37 -0000
@@ -1237,10 +1237,9 @@
           if ( error && error != TTO_Err_Not_Covered )
             return error;
 
-          if ( in->pos + j < in->length )
-            j++;
-          else
-            break;
+          j++;
+          if ( in->pos + j == in->length )
+            goto next_ligature;
         }
 
         if ( !( property == TTO_MARK || property & IGNORE_SPECIAL_MARKS ) )
@@ -1311,6 +1310,7 @@
 
         return TT_Err_Ok;
       }
+    next_ligature: ;
     }
 
     return TTO_Err_Not_Covered;
@@ -2135,10 +2135,9 @@
           if ( error && error != TTO_Err_Not_Covered )
             return error;
 
-          if ( in->pos + j < in->length )
-            j++;
-          else
-            break;
+          j++;
+          if ( in->pos + j == in->length )
+            goto next_subrule;
         }
 
         if ( s_in[j] != sr[k].Input[i - 1] )
@@ -2150,6 +2149,7 @@
                                 sr[k].SubstCount, sr[k].SubstLookupRecord,
                                 in, out,
                                 nesting_level );
+    next_subrule: ;
     }
 
     return TTO_Err_Not_Covered;
@@ -2230,10 +2230,9 @@
           if ( error && error != TTO_Err_Not_Covered )
             goto End;
 
-          if ( in->pos + j < in->length )
-            j++;
-          else
-            break;
+          j++;
+          if ( in->pos + j == in->length )
+            goto next_subclassrule;
         }
 
         if ( i > known_classes )
@@ -2258,6 +2257,7 @@
                                  nesting_level );
         goto End;
       }
+    next_subclassrule: ;
     }
 
     error = TTO_Err_Not_Covered;
@@ -2306,9 +2306,8 @@
         if ( error && error != TTO_Err_Not_Covered )
           return error;
 
-        if ( in->pos + j < in->length )
-          j++;
-        else
+        j++;
+        if ( in->pos + j == in->length )
           return TTO_Err_Not_Covered;
       }
 
@@ -3440,7 +3439,7 @@
             if ( j > curr_pos )
               j--;
             else
-              break;
+              goto next_chainsubrule;
           }
 
           /* In OpenType 1.3, it is undefined whether the offsets of
@@ -3473,10 +3472,9 @@
           if ( error && error != TTO_Err_Not_Covered )
             return error;
 
-          if ( curr_pos + j < in->length )
-            j++;
-          else
-            break;
+          j++;
+          if ( curr_pos + j == in->length )
+            goto next_chainsubrule;
         }
 
         if ( s_in[j] != curr_csr.Input[i - 1] )
@@ -3499,10 +3497,9 @@
           if ( error && error != TTO_Err_Not_Covered )
             return error;
 
-          if ( curr_pos + j < in->length )
-            j++;
-          else
-            break;
+          j++;
+          if ( curr_pos + j == in->length )
+            goto next_chainsubrule;
         }
 
         if ( s_in[j] != curr_csr.Lookahead[i] )
@@ -3515,6 +3512,7 @@
                                 curr_csr.SubstLookupRecord,
                                 in, out,
                                 nesting_level );
+    next_chainsubrule: ;
     }
 
     return TTO_Err_Not_Covered;
@@ -3627,7 +3625,7 @@
             if ( j > curr_pos )
               j--;
             else
-              break;
+              goto next_chainsubclassrule;
           }
 
           if ( i >= known_backtrack_classes )
@@ -3662,10 +3660,9 @@
           if ( error && error != TTO_Err_Not_Covered )
             goto End1;
 
-          if ( curr_pos + j < in->length )
-            j++;
-          else
-            break;
+          j++;
+          if ( curr_pos + j == in->length )
+            goto next_chainsubclassrule;
         }
 
         if ( i >= known_input_classes )
@@ -3698,10 +3695,9 @@
           if ( error && error != TTO_Err_Not_Covered )
             goto End1;
 
-          if ( curr_pos + j < in->length )
-            j++;
-          else
-            break;
+          j++;
+          if ( curr_pos + j == in->length )
+            goto next_chainsubclassrule;
         }
 
         if ( i >= known_lookahead_classes )
@@ -3726,6 +3722,7 @@
                                  nesting_level );
         goto End1;
       }
+    next_chainsubclassrule: ;
     }
 
     error = TTO_Err_Not_Covered;
@@ -3820,9 +3817,8 @@
         if ( error && error != TTO_Err_Not_Covered )
           return error;
 
-        if ( curr_pos + j < in->length )
-          j++;
-        else
+        j++;
+        if ( curr_pos + j == in->length )
           return TTO_Err_Not_Covered;
       }
 
@@ -3845,9 +3841,8 @@
         if ( error && error != TTO_Err_Not_Covered )
           return error;
 
-        if ( curr_pos + j < in->length )
-          j++;
-        else
+        j++;
+        if ( curr_pos + j == in->length )
           return TTO_Err_Not_Covered;
       }
 
