提交 ff199ba3 编写于 作者: B Behdad Esfahbod

Fix shaper_list manipulation, aaaaaaaaaaaaargh

上级 206e3293
...@@ -78,7 +78,7 @@ static struct static_shaper_list_t ...@@ -78,7 +78,7 @@ static struct static_shaper_list_t
} }
unsigned int count = 3; /* initial, fallback, null */ unsigned int count = 3; /* initial, fallback, null */
for (const char *p = env; (p == strchr (p, ',')) && p++; ) for (const char *p = env; (p = strchr (p, ',')) && p++; )
count++; count++;
unsigned int len = strlen (env); unsigned int len = strlen (env);
...@@ -95,7 +95,7 @@ static struct static_shaper_list_t ...@@ -95,7 +95,7 @@ static struct static_shaper_list_t
count = 0; count = 0;
shaper_list[count++] = buffer; shaper_list[count++] = buffer;
for (char *p = buffer; (p == strchr (p, ',')) && (*p = '\0', TRUE) && p++; ) for (char *p = buffer; (p = strchr (p, ',')) && (*p = '\0', TRUE) && p++; )
shaper_list[count++] = p; shaper_list[count++] = p;
shaper_list[count++] = "fallback"; shaper_list[count++] = "fallback";
shaper_list[count] = NULL; shaper_list[count] = NULL;
...@@ -136,11 +136,13 @@ hb_shape_full (hb_font_t *font, ...@@ -136,11 +136,13 @@ hb_shape_full (hb_font_t *font,
} else { } else {
while (*shaper_list) { while (*shaper_list) {
for (unsigned int i = 0; i < ARRAY_LENGTH (shapers); i++) for (unsigned int i = 0; i < ARRAY_LENGTH (shapers); i++)
if (0 == strcmp (*shaper_list, shapers[i].name) && if (0 == strcmp (*shaper_list, shapers[i].name)) {
likely (shapers[i].func (font, buffer, if (likely (shapers[i].func (font, buffer,
features, num_features, features, num_features,
shaper_options))) shaper_options)))
return TRUE; return TRUE;
break;
}
shaper_list++; shaper_list++;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册