diff --git a/HISTORY b/HISTORY index ef95c45..c096b6b 100755 --- a/HISTORY +++ b/HISTORY @@ -1,3 +1,6 @@ +May. 5 2016 +Fixed a column counting bug with UTF8 + Apr. 29 2016 Fixed a loading bug when importing a UTF8 file diff --git a/core/my_basic.c b/core/my_basic.c index 2a7a5d1..8f9e6c6 100755 --- a/core/my_basic.c +++ b/core/my_basic.c @@ -11929,17 +11929,20 @@ int mb_load_string(struct mb_interpreter_t* s, const char* l, bool_t reset) { if(context->parsing_state == _PS_NORMAL) n = mb_uu_ischar(l); #endif /* MB_ENABLE_UNICODE_ID */ - if(n == 1) { - char ch = *l; - if((ch == _NEWLINE_CHAR || ch == _RETURN_CHAR) && (!wrapped || wrapped == ch)) { - wrapped = ch; - ++context->parsing_row; - context->parsing_col = 0; - } else { - wrapped = _ZERO_CHAR; - ++context->parsing_col; + do { + if(n == 1) { + char ch = *l; + if((ch == _NEWLINE_CHAR || ch == _RETURN_CHAR) && (!wrapped || wrapped == ch)) { + wrapped = ch; + ++context->parsing_row; + context->parsing_col = 0; + + break; + } } - } + wrapped = _ZERO_CHAR; + ++context->parsing_col; + } while(0); status = _parse_char(s, l, n, context->parsing_pos, _row, _col); result = status; if(status) { diff --git a/output/my_basic.exe b/output/my_basic.exe index 68d4d21..d23860d 100755 Binary files a/output/my_basic.exe and b/output/my_basic.exe differ