Skip to content

Fix rawLine: and offsetOfRawLine:#589

Merged
gnachman merged 1 commit intognachman:masterfrom
chall37:fix/rawLine-offsetOfRawLine-buffer-start-offset
Feb 24, 2026
Merged

Fix rawLine: and offsetOfRawLine:#589
gnachman merged 1 commit intognachman:masterfrom
chall37:fix/rawLine-offsetOfRawLine-buffer-start-offset

Conversation

@chall37
Copy link
Contributor

@chall37 chall37 commented Feb 21, 2026

The fix mirrors the existing correct logic in _lineRawOffset: and lengthOfRawLine: corrected in 05d178c.

…ne drops

Both methods hardcoded linenum == 0 → start = 0 instead of checking
linenum == _firstEntry → start = bufferStartOffset. After dropLines
advances _firstEntry and sets bufferStartOffset to a non-zero value,
they returned a pointer/offset that started too early in the buffer,
reading dropped data and missing the tail of live data.

The fix mirrors the existing correct logic in _lineRawOffset: and
lengthOfRawLine:.
@gnachman gnachman merged commit b63e4de into gnachman:master Feb 24, 2026
1 check passed
@gnachman
Copy link
Owner

Good catch!

eyupcanakman pushed a commit to eyupcanakman/iTerm2 that referenced this pull request Mar 1, 2026
…ne drops (gnachman#589)

Both methods hardcoded linenum == 0 → start = 0 instead of checking
linenum == _firstEntry → start = bufferStartOffset. After dropLines
advances _firstEntry and sets bufferStartOffset to a non-zero value,
they returned a pointer/offset that started too early in the buffer,
reading dropped data and missing the tail of live data.

The fix mirrors the existing correct logic in _lineRawOffset: and
lengthOfRawLine:.

Co-authored-by: chall37 <chall37@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants