[deserialize] Some more

pull/4083/head
Behdad Esfahbod 2 years ago
parent 57ff696430
commit b44ff062e1
  1. 9
      src/hb-buffer-deserialize-text-glyphs.hh
  2. 9
      src/hb-buffer-deserialize-text-glyphs.rl
  3. 9
      src/hb-buffer-deserialize-text-unicode.hh
  4. 9
      src/hb-buffer-deserialize-text-unicode.rl
  5. 2
      src/test-buffer-serialize.cc

@ -322,7 +322,7 @@ _hb_buffer_deserialize_text_glyphs (hb_buffer_t *buffer,
const char **end_ptr,
hb_font_t *font)
{
const char *p = buf, *pe = buf + buf_len, *eof = pe;
const char *p = buf, *pe = buf + buf_len, *eof = pe, *orig_pe = pe;
/* Ensure we have positions. */
(void) hb_buffer_get_glyph_positions (buffer, nullptr);
@ -677,6 +677,13 @@ _again:
#line 136 "hb-buffer-deserialize-text-glyphs.rl"
if (pe < orig_pe && *pe == ']')
{
pe++;
if (p == pe)
p++;
}
*end_ptr = p;
return p == pe;

@ -104,7 +104,7 @@ _hb_buffer_deserialize_text_glyphs (hb_buffer_t *buffer,
const char **end_ptr,
hb_font_t *font)
{
const char *p = buf, *pe = buf + buf_len, *eof = pe;
const char *p = buf, *pe = buf + buf_len, *eof = pe, *orig_pe = pe;
/* Ensure we have positions. */
(void) hb_buffer_get_glyph_positions (buffer, nullptr);
@ -135,6 +135,13 @@ _hb_buffer_deserialize_text_glyphs (hb_buffer_t *buffer,
write exec;
}%%
if (pe < orig_pe && *pe == ']')
{
pe++;
if (p == pe)
p++;
}
*end_ptr = p;
return p == pe;

@ -172,7 +172,7 @@ _hb_buffer_deserialize_text_unicode (hb_buffer_t *buffer,
const char **end_ptr,
hb_font_t *font)
{
const char *p = buf, *pe = buf + buf_len, *eof = pe;
const char *p = buf, *pe = buf + buf_len, *eof = pe, *orig_pe = pe;
while (p < pe && ISSPACE (*p))
p++;
@ -317,6 +317,13 @@ _again:
#line 115 "hb-buffer-deserialize-text-unicode.rl"
if (pe < orig_pe && *pe == '>')
{
pe++;
if (p == pe)
p++;
}
*end_ptr = p;
return p == pe;

@ -85,7 +85,7 @@ _hb_buffer_deserialize_text_unicode (hb_buffer_t *buffer,
const char **end_ptr,
hb_font_t *font)
{
const char *p = buf, *pe = buf + buf_len, *eof = pe;
const char *p = buf, *pe = buf + buf_len, *eof = pe, *orig_pe = pe;
while (p < pe && ISSPACE (*p))
p++;
@ -114,6 +114,13 @@ _hb_buffer_deserialize_text_unicode (hb_buffer_t *buffer,
write exec;
}%%
if (pe < orig_pe && *pe == '>')
{
pe++;
if (p == pe)
p++;
}
*end_ptr = p;
return p == pe;

@ -77,7 +77,7 @@ main (int argc, char **argv)
break;
}
if (*p == ']' || *p == '\n')
if (*p == '\n')
break;
if (p == line)
{

Loading…
Cancel
Save