(parse_otf_command): Fix previous change.
authorhanda <handa>
Thu, 16 Sep 2010 11:11:37 +0000 (11:11 +0000)
committerhanda <handa>
Thu, 16 Sep 2010 11:11:37 +0000 (11:11 +0000)
src/m17n-flt.c

index 7a34e3d..b6fcad6 100644 (file)
@@ -742,16 +742,16 @@ otf_store_features (char *p, char *end, unsigned *buf)
   buf[i] = 0;
 }
 
-/* SYMBOL's name       features[0] [1] for checking    for applying
-   -------------       --------------- ------------    ------------
-   SCRIPT              [0]         [0]     any|any        all  all
-   SCRIPT=             NULL        [0]    none&1         none  all
-   SCRIPT+             [0]        NULL       1&none       all  none
-   SCRIPT=F1           [F1,0]      [0]      F1&1           F1  all
-   SCRIPT+F1           [0]      [F1,0]    none&F1        none  F1
-   SCRIPT=F1+          [F1,0]     NULL      F1&none        F1  none
-   SCRIPT=~F2          [-1,F2,0]   [0]     ~F2&1       all~F2  all
-   SCRIPT=F1,~F2       [F1,-1,A2,0][0]  F1&~F2&1       F1 (*1) all
+/* SYMBOL's name       features[0]    [1]      for checking    for applying
+   -------------       ------------------      ------------    ------------
+   SCRIPT              [-1,0]      [-1,0]          any|any        all  all
+   SCRIPT=             NULL        [-1,0]         none&1         none  all
+   SCRIPT+             [-1,0]        NULL            1&none       all  none
+   SCRIPT=F1           [F1,0]      [-1,0]           F1&1           F1  all
+   SCRIPT+F1           [-1][0]     [F1,0]         none&F1        none  F1
+   SCRIPT=F1+          [F1,0]        NULL           F1&none        F1  none
+   SCRIPT=~F2          [-1,F2,0]   [-1,0]          ~F2&1       all~F2  all
+   SCRIPT=F1,~F2       [F1,-1,A2,0][-1,0]       F1&~F2&1       F1 (*1) all
 
    (*1) Invalid specification
  */
@@ -815,14 +815,16 @@ parse_otf_command (MSymbol symbol, MFLTOtfSpec *spec)
   for (i = 0; i < 2; i++)
     if (feature_count[i])
       {
-       spec->features[i] = malloc (sizeof (int) * (feature_count[i] + 1));
+       spec->features[i] = malloc (sizeof (int)
+                                   * (feature_count[i] < 0 ? 2
+                                      : feature_count[i] + 1));
        if (! spec->features[i])
          return -2;
        if (feature_count[i] > 0)
          otf_store_features (features[i] + 1, features[i + 1],
                              spec->features[i]);
        else
-         spec->features[i][1] = 0;
+         spec->features[i][0] = 0xFFFFFFFF, spec->features[i][1] = 0;
       }
 
   return 0;