You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note that fprintf has no check on its return value so it could fail without being reported. I am unsure if the IO errors turn the FILE * into some poison that would cause the fclose() to fail, but somehow I suspect they would not.
The text was updated successfully, but these errors were encountered:
Also, the errno handling here completely violates the semantics of how readline does it: the return value should be 0 on success or errno on failure, and EOF is not a valid errno value. GNU readline by comparison does not guarantee that errno the global variable will not be clobbered on return, so the only way of getting its errno out is to look at the return value, but editline return value here is not always a valid errno.
The fix for that is to stop returning EOF and return errno there instead.
The editline library is not intended to be a drop-in replacement for GNU readline. That being said, it's always a good idea to follow the principle of least surprise.
Pull requests are welcome that improve the stability and usability of the library.
editline/src/editline.c
Lines 1619 to 1634 in c50d4c3
Note that fprintf has no check on its return value so it could fail without being reported. I am unsure if the IO errors turn the
FILE *
into some poison that would cause the fclose() to fail, but somehow I suspect they would not.The text was updated successfully, but these errors were encountered: