[util] Strip quotes when parsing features

When running in batch mode, the quotes are not stripped by the shell and
end up in the feature string. This breaks one of the AOTS tests.

Alternatively, we can remove the quotes from the test files, not sure
which is less hacky, though!
pull/3087/head
Khaled Hosny 4 years ago committed by Behdad Esfahbod
parent ad9559e3e2
commit 92b85749f2
  1. 2
      test/shaping/data/aots/tests/gsub3_1_simple.tests
  2. 8
      util/options.cc

@ -1 +1 @@
#../fonts/gsub3_1_simple_f1.otf:--features="-test[1],test[3],test[5]=2,test[7]=3,-test[9],test[11]" --no-clusters --no-glyph-names --no-positions:U+0011,U+0012,U+0011,U+0012,U+0011,U+0012,U+0011,U+0012,U+0011,U+0012,U+0011,U+0012,U+0011:[17|18|17|20|17|21|17|22|17|18|17|20|17]
../fonts/gsub3_1_simple_f1.otf:--features="-test[1],test[3],test[5]=2,test[7]=3,-test[9],test[11]" --no-clusters --no-glyph-names --no-positions:U+0011,U+0012,U+0011,U+0012,U+0011,U+0012,U+0011,U+0012,U+0011,U+0012,U+0011,U+0012,U+0011:[17|18|17|20|17|21|17|22|17|18|17|20|17]

@ -258,12 +258,20 @@ parse_features (const char *name G_GNUC_UNUSED,
{
shape_options_t *shape_opts = (shape_options_t *) data;
char *s = (char *) arg;
size_t l = strlen (s);
char *p;
shape_opts->num_features = 0;
g_free (shape_opts->features);
shape_opts->features = nullptr;
/* if the string is quoted, strip the quotes */
if (s[0] == s[l - 1] && (s[0] == '\"' || s[0] == '\''))
{
s[l - 1] = '\0';
s++;
}
if (!*s)
return true;

Loading…
Cancel
Save