diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2015-04-04 01:55:40 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2015-04-04 01:55:40 +0300 |
commit | 7f59b4b2ca28179c72aa12f35fe59cb14017b5b0 (patch) | |
tree | 7c4f7dbf998bed68a1628acf11f8d375158c59f2 /py | |
parent | acf6aec71cef3dae4431b79f6e530d3c8994a8b4 (diff) | |
download | micropython-7f59b4b2ca28179c72aa12f35fe59cb14017b5b0.tar.gz micropython-7f59b4b2ca28179c72aa12f35fe59cb14017b5b0.zip |
objstr: Fix bugs introduced by inability to have shadow variables.
Warnings lead to programming errors - as expected.
Diffstat (limited to 'py')
-rw-r--r-- | py/objstr.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/py/objstr.c b/py/objstr.c index 4f032d38c3..a7eb629be4 100644 --- a/py/objstr.c +++ b/py/objstr.c @@ -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)); |