Module Name: src
Committed By: christos
Date: Tue Jun 5 00:30:22 UTC 2012
Modified Files:
src/lib/libedit: readline.c
Log Message:
don't crash if add_history is called from an empty line. Called from
nslookup in new bind.
XXX: pullup to 6
To generate a diff of this commit:
cvs rdiff -u -r1.103 -r1.104 src/lib/libedit/readline.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libedit/readline.c
diff -u src/lib/libedit/readline.c:1.103 src/lib/libedit/readline.c:1.104
--- src/lib/libedit/readline.c:1.103 Tue May 15 15:07:25 2012
+++ src/lib/libedit/readline.c Mon Jun 4 20:30:22 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: readline.c,v 1.103 2012/05/15 19:07:25 christos Exp $ */
+/* $NetBSD: readline.c,v 1.104 2012/06/05 00:30:22 christos Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include "config.h"
#if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: readline.c,v 1.103 2012/05/15 19:07:25 christos Exp $");
+__RCSID("$NetBSD: readline.c,v 1.104 2012/06/05 00:30:22 christos Exp $");
#endif /* not lint && not SCCSID */
#include <sys/types.h>
@@ -1372,6 +1372,9 @@ add_history(const char *line)
{
HistEvent ev;
+ if (line == NULL)
+ return 0;
+
if (h == NULL || e == NULL)
rl_initialize();