if (len >= ONIGENC_MBC_MINLEN(env->enc)) {
if (len == enclen(env->enc, STR_(*np)->s)) {/* should not enclen_end() */
r = fetch_token(tok, src, end, env);
- NODE_STRING_CLEAR_RAW(*np);
- goto string_end;
+ goto tk_raw_byte_end;
}
}
rem = ONIGENC_MBC_MINLEN(env->enc) - len;
(void )node_str_head_pad(STR_(*np), rem, (UChar )0);
if (len + rem == enclen(env->enc, STR_(*np)->s)) {
- NODE_STRING_CLEAR_RAW(*np);
- goto string_end;
+ goto tk_raw_byte_end;
}
}
#endif
len++;
}
+
+ tk_raw_byte_end:
+ if (! ONIGENC_IS_VALID_MBC_STRING(env->enc, STR_(*np)->s, STR_(*np)->end))
+ return ONIGERR_INVALID_WIDE_CHAR_VALUE;
+
+ NODE_STRING_CLEAR_RAW(*np);
+ goto string_end;
}
break;