提交 144cd49a 编写于 作者: B Behdad Esfahbod

[buffer] Accept -1 for text_length and item_length

A -1 text_length means: zero-terminated string.
A -1 item_length means: to the end of string.
上级 e9c71fab
......@@ -712,6 +712,16 @@ hb_buffer_guess_properties (hb_buffer_t *buffer)
#define ADD_UTF(T) \
HB_STMT_START { \
if (text_length == -1) { \
text_length = 0; \
const T *p = (const T *) text; \
while (*p) { \
text_length++; \
p++; \
} \
} \
if (item_length == -1) \
item_length = text_length - item_offset; \
const T *next = (const T *) text + item_offset; \
const T *end = next + item_length; \
while (next < end) { \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册