Commit 09925888 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

py/frozenmod: Make frozen module content be 0-terminated.

To allow simple zero-terminated lexers.
parent ed584e2f
......@@ -46,7 +46,7 @@ mp_lexer_t *mp_find_frozen_module(const char *str, int len) {
mp_lexer_t *lex = mp_lexer_new_from_str_len(MP_QSTR_, s, *sz_ptr, 0);
return lex;
}
s += l + 1 + *sz_ptr++;
s += (l + 1) + (*sz_ptr++ + 1);
}
return NULL;
}
......
......@@ -55,5 +55,5 @@ for f, st in modules:
data = data[1:]
data = data[1:-1]
data = data.replace('"', '\\"')
print('"%s"' % data)
print('"%s\\0"' % data)
print("};")
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment