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

Improve BSD editline compatibility #51

Merged
merged 2 commits into from
Aug 13, 2024

Conversation

rkraats
Copy link
Contributor

@rkraats rkraats commented Jul 4, 2023

Two changes to allow for building/running against the BSD editline library (libedit, see https://www.thrysoee.dk/editline/) instead of GNU readline. Tested with libedit 3.1-20221030 (using configure arguments --with-readline-includes=/usr/include/editline --with-readline-library='-ledit').

Please consider merging.

GNU readline doesn't seem to ever return 0, but (e.g.) BSD editline
(libedit) can return 0 (indicating that no expansion took place),
while leaving the output pointer NULL. Handle return value 0 for
compatibility with both libraries.
The BSD editline library (libedit, version 3.1-20221030) doesn't
implement the rl_extend_line_buffer function. Alternative approaches to
replace the line buffer using the readline interface don't give the
desired behavior. So simply don't use history expansion in the
completion function if the rl_extend_line_buffer function is not
available.
@rkraats rkraats changed the title Improve BSD editline compatilibity Improve BSD editline compatibility Jul 4, 2023
@bovine bovine requested a review from resuna January 22, 2024 17:52
@bovine bovine merged commit 9915a12 into flightaware:master Aug 13, 2024
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