forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit309ff2a
committed
Remove workaround for ancient incompatibility between readline and libedit.
GNU readline defines the return value of write_history() as "zero if OK,else an errno code". libedit's version of that function used to have adifferent definition (to wit, "-1 if error, else the number of lineswritten to the file"). We tried to work around that by checking whethererrno had become nonzero, but this method has never been kosher accordingto the published API of either library. It's reportedly completely brokenin recent Ubuntu releases: psql bleats about "No such file or directory"when saving ~/.psql_history, even though the write worked fine.However, libedit has been following the readline definition since somewherearound 2006, so it seems all right to finally break compatibility withancient libedit releases and trust that the return value is what readlinespecifies. (I'm not sure when the various Linux distributions incorporatedthis fix, but I did find that OS X has been shipping fixed versions since10.5/Leopard.)If anyone is still using such an ancient libedit, they will find that psqlcomplains it can't write ~/.psql_history at exit, even when the file waswritten correctly. This is no worse than the behavior we're fixing forcurrent releases.Back-patch to all supported branches.1 parent4909cb5 commit309ff2a
1 file changed
+6
-11
lines changedLines changed: 6 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
386 | 386 |
| |
387 | 387 |
| |
388 | 388 |
| |
| 389 | + | |
389 | 390 |
| |
390 | 391 |
| |
391 | 392 |
| |
| |||
409 | 410 |
| |
410 | 411 |
| |
411 | 412 |
| |
412 |
| - | |
413 |
| - | |
414 |
| - | |
415 |
| - | |
416 | 413 |
| |
417 | 414 |
| |
418 | 415 |
| |
| |||
434 | 431 |
| |
435 | 432 |
| |
436 | 433 |
| |
437 |
| - | |
438 |
| - | |
439 |
| - | |
| 434 | + | |
| 435 | + | |
440 | 436 |
| |
441 | 437 |
| |
442 | 438 |
| |
| |||
445 | 441 |
| |
446 | 442 |
| |
447 | 443 |
| |
448 |
| - | |
449 |
| - | |
450 |
| - | |
| 444 | + | |
| 445 | + | |
451 | 446 |
| |
452 | 447 |
| |
453 | 448 |
| |
454 | 449 |
| |
455 | 450 |
| |
456 |
| - | |
| 451 | + | |
457 | 452 |
| |
458 | 453 |
| |
459 | 454 |
| |
|
0 commit comments
Comments
(0)