[util] Accept space as delimiter for --features/--variations

Fixes https://github.com/harfbuzz/harfbuzz/issues/3715
This commit is contained in:
Behdad Esfahbod 2022-07-18 14:47:49 -06:00
parent 378663409a
commit 1eb8e82086
2 changed files with 4 additions and 4 deletions

View File

@ -173,7 +173,7 @@ parse_variations (const char *name G_GNUC_UNUSED,
p = s;
do {
font_opts->num_variations++;
p = strchr (p, ',');
p = strpbrk (p, ", ");
if (p)
p++;
} while (p);
@ -186,7 +186,7 @@ parse_variations (const char *name G_GNUC_UNUSED,
p = s;
font_opts->num_variations = 0;
while (p && *p) {
char *end = strchr (p, ',');
char *end = strpbrk (p, ", ");
if (hb_variation_from_string (p, end ? end - p : -1, &font_opts->variations[font_opts->num_variations]))
font_opts->num_variations++;
p = end ? end + 1 : nullptr;

View File

@ -218,7 +218,7 @@ parse_features (const char *name G_GNUC_UNUSED,
p = s;
do {
shape_opts->num_features++;
p = strchr (p, ',');
p = strpbrk (p, ", ");
if (p)
p++;
} while (p);
@ -231,7 +231,7 @@ parse_features (const char *name G_GNUC_UNUSED,
p = s;
shape_opts->num_features = 0;
while (p && *p) {
char *end = strchr (p, ',');
char *end = strpbrk (p, ", ");
if (hb_feature_from_string (p, end ? end - p : -1, &shape_opts->features[shape_opts->num_features]))
shape_opts->num_features++;
p = end ? end + 1 : nullptr;