Skip to content

142 incorrect line numbers in getlogicallines - #143

Merged
da4089 merged 2 commits into
branch-0.9from
142-incorrect-line-numbers-in-getlogicallines
Aug 12, 2026
Merged

142 incorrect line numbers in getlogicallines#143
da4089 merged 2 commits into
branch-0.9from
142-incorrect-line-numbers-in-getlogicallines

Conversation

@da4089

@da4089 da4089 commented Aug 12, 2026

Copy link
Copy Markdown

The regex used to identify the end of a logical line attempted to deal with a missing line terminator, but in doing so, caused an error in the reported line numbers for parsing errors.

This patch fixes that.

da4089 added 2 commits August 11, 2026 23:20
In some cases, the vobject text supplied does not have a line
terminator on the final line of the string/file.  This was handled
using the regex "$" syntax, but that meant every line was reporting
an extra line number consumed, because "$" matches either the end
of the string, or immediately before a final CR/LF.

So, logical lines still match either a CRLF, CR, LF, or "$", but
when removing folded lines, there's now an explicit check for a
training terminator, and one is added if it's missing.  That ensures
every line increments the counter by at least one, and the returned
line numbers are now correct for both folded and unfolded lines.
@da4089
da4089 merged commit e1dbef1 into branch-0.9 Aug 12, 2026
6 checks passed
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.

1 participant