3657. [port] Some readline clones don't accept NULL pointers when

calling add_history. [RT #34842]

(cherry picked from commit 1a4725bef2)
This commit is contained in:
Mark Andrews 2013-09-26 08:25:09 +10:00
parent 0c1e0b4c88
commit 394c3ab760
3 changed files with 7 additions and 2 deletions

View file

@ -1,3 +1,6 @@
3657. [port] Some readline clones don't accept NULL pointers when
calling add_history. [RT #34842]
3656. [bug] Treat a all zero netmask as invalid when generating
the localnets acl. [RT #34687]

View file

@ -776,7 +776,8 @@ get_next_command(void) {
if (interactive) {
#ifdef HAVE_READLINE
ptr = readline("> ");
add_history(ptr);
if (ptr != NULL)
add_history(ptr);
#else
fputs("> ", stderr);
fflush(stderr);

View file

@ -2008,7 +2008,8 @@ get_next_command(void) {
if (interactive) {
#ifdef HAVE_READLINE
cmdline = readline("> ");
add_history(cmdline);
if (cmdline != NULL)
add_history(cmdline);
#else
fprintf(stdout, "> ");
fflush(stdout);