Commit 7f59b4b2 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

objstr: Fix bugs introduced by inability to have shadow variables.

Warnings lead to programming errors - as expected.
parent acf6aec7
......@@ -519,8 +519,8 @@ STATIC inline mp_obj_t str_split_internal(mp_uint_t n_args, const mp_obj_t *args
s++;
}
mp_uint_t sub_len = s - start;
if (MP_LIKELY(!(len == 0 && s == top && (type && SPLITLINES)))) {
if (start + len != top && (type & KEEP)) {
if (MP_LIKELY(!(sub_len == 0 && s == top && (type && SPLITLINES)))) {
if (start + sub_len != top && (type & KEEP)) {
sub_len++;
}
mp_obj_list_append(res, mp_obj_new_str_of_type(self_type, start, sub_len));
......
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