Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly handle multi-line strings and newline returned by readline() #139

Merged
merged 1 commit into from
Jan 5, 2024

Conversation

gromit1811
Copy link

Fix for #138

According to https://lists.gnu.org/archive/html/bug-readline/2024-01/msg00000.html it's OK for readline() to return multi-line strings and/or newlines in case of bracketed paste (enabled by default since readline 8.1) and also in other situations even though its documentation explicitly states the opposite. So we need to handle this properly in calc instead of just using the first line and dropping the rest: Split the string returned by readline() into lines and return line by line with each invocation of hist_getline(), each possbily adding a terminating newline.

Fix for lcn2#138

According to
https://lists.gnu.org/archive/html/bug-readline/2024-01/msg00000.html
it's OK for readline() to return multi-line strings and/or newlines in case
of bracketed paste (enabled by default since readline 8.1) and also in other
situations even though its documentation explicitly states the opposite. So
we need to handle this properly in calc instead of just using the first line
and dropping the rest: Split the string returned by readline() into lines
and return line by line with each invocation of hist_getline(), each
possbily adding a terminating newline.
@lcn2
Copy link
Owner

lcn2 commented Jan 5, 2024

Thank you very much, @gromit1811 for dong the research and taking the time to do this pull request.

We will begin testing this pull request via the master branch. Thanks again!

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