From 394c3ab760cc4b7c41c28852c2d4452879bc819d Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 26 Sep 2013 08:25:09 +1000 Subject: [PATCH] 3657. [port] Some readline clones don't accept NULL pointers when calling add_history. [RT #34842] (cherry picked from commit 1a4725bef25e60de161f77318f362c327b690d72) --- CHANGES | 3 +++ bin/dig/nslookup.c | 3 ++- bin/nsupdate/nsupdate.c | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 48e8e8d611..7203ad9698 100644 --- a/CHANGES +++ b/CHANGES @@ -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] diff --git a/bin/dig/nslookup.c b/bin/dig/nslookup.c index d5ef50b7f6..6c2f0a9499 100644 --- a/bin/dig/nslookup.c +++ b/bin/dig/nslookup.c @@ -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); diff --git a/bin/nsupdate/nsupdate.c b/bin/nsupdate/nsupdate.c index e96c075b67..e9105b1a17 100644 --- a/bin/nsupdate/nsupdate.c +++ b/bin/nsupdate/nsupdate.c @@ -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);