[util] Accept space as delimiter for --features/--variations
Fixes https://github.com/harfbuzz/harfbuzz/issues/3715
This commit is contained in:
parent
378663409a
commit
1eb8e82086
|
@ -173,7 +173,7 @@ parse_variations (const char *name G_GNUC_UNUSED,
|
||||||
p = s;
|
p = s;
|
||||||
do {
|
do {
|
||||||
font_opts->num_variations++;
|
font_opts->num_variations++;
|
||||||
p = strchr (p, ',');
|
p = strpbrk (p, ", ");
|
||||||
if (p)
|
if (p)
|
||||||
p++;
|
p++;
|
||||||
} while (p);
|
} while (p);
|
||||||
|
@ -186,7 +186,7 @@ parse_variations (const char *name G_GNUC_UNUSED,
|
||||||
p = s;
|
p = s;
|
||||||
font_opts->num_variations = 0;
|
font_opts->num_variations = 0;
|
||||||
while (p && *p) {
|
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]))
|
if (hb_variation_from_string (p, end ? end - p : -1, &font_opts->variations[font_opts->num_variations]))
|
||||||
font_opts->num_variations++;
|
font_opts->num_variations++;
|
||||||
p = end ? end + 1 : nullptr;
|
p = end ? end + 1 : nullptr;
|
||||||
|
|
|
@ -218,7 +218,7 @@ parse_features (const char *name G_GNUC_UNUSED,
|
||||||
p = s;
|
p = s;
|
||||||
do {
|
do {
|
||||||
shape_opts->num_features++;
|
shape_opts->num_features++;
|
||||||
p = strchr (p, ',');
|
p = strpbrk (p, ", ");
|
||||||
if (p)
|
if (p)
|
||||||
p++;
|
p++;
|
||||||
} while (p);
|
} while (p);
|
||||||
|
@ -231,7 +231,7 @@ parse_features (const char *name G_GNUC_UNUSED,
|
||||||
p = s;
|
p = s;
|
||||||
shape_opts->num_features = 0;
|
shape_opts->num_features = 0;
|
||||||
while (p && *p) {
|
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]))
|
if (hb_feature_from_string (p, end ? end - p : -1, &shape_opts->features[shape_opts->num_features]))
|
||||||
shape_opts->num_features++;
|
shape_opts->num_features++;
|
||||||
p = end ? end + 1 : nullptr;
|
p = end ? end + 1 : nullptr;
|
||||||
|
|
Loading…
Reference in New Issue