py/frozenmod: Make frozen module content be 0-terminated.
To allow simple zero-terminated lexers.
This commit is contained in:
parent
ed584e2ffd
commit
0992588811
@ -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);
|
mp_lexer_t *lex = mp_lexer_new_from_str_len(MP_QSTR_, s, *sz_ptr, 0);
|
||||||
return lex;
|
return lex;
|
||||||
}
|
}
|
||||||
s += l + 1 + *sz_ptr++;
|
s += (l + 1) + (*sz_ptr++ + 1);
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -55,5 +55,5 @@ for f, st in modules:
|
|||||||
data = data[1:]
|
data = data[1:]
|
||||||
data = data[1:-1]
|
data = data[1:-1]
|
||||||
data = data.replace('"', '\\"')
|
data = data.replace('"', '\\"')
|
||||||
print('"%s"' % data)
|
print('"%s\\0"' % data)
|
||||||
print("};")
|
print("};")
|
||||||
|
Loading…
Reference in New Issue
Block a user