Skip to content

Commit

Permalink
objstr: Fix bugs introduced by inability to have shadow variables.
Browse files Browse the repository at this point in the history
Warnings lead to programming errors - as expected.
  • Loading branch information
pfalcon committed Apr 3, 2015
1 parent acf6aec commit 7f59b4b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions py/objstr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 7f59b4b

Please sign in to comment.