In case LF was found for a long line way outside of the limit, we should
not need to update the delimiter len and current line len because the
line is capped at 4k and the LF was not within these 4k bytes.
state->current_line_len = lf_idx - state->input;
}
- if (state->input != lf_idx &&
- *(lf_idx - 1) == 0x0D) {
- state->current_line_len--;
- state->current_line_delimiter_len = 2;
- } else {
- state->current_line_delimiter_len = 1;
+ if (!*current_line_truncated) {
+ if (state->input != lf_idx && *(lf_idx - 1) == 0x0D) {
+ state->current_line_len--;
+ state->current_line_delimiter_len = 2;
+ } else {
+ state->current_line_delimiter_len = 1;
+ }
}
}