+#include "version.h"
+#include "getline.h"
+
+#if HAVE_READLINE_READLINE_H
+# include <readline/readline.h>
+#endif
+#if HAVE_RL_ADD_HISTORY && HAVE_READLINE_HISTORY_H
+# include <readline/history.h>
+
+/* call add_history only if the line is non-blank */
+static void do_add_history(const char *line)
+{
+ if (line[strspn(line, " \t")])
+ add_history(line);
+}
+#else
+static void do_add_history(const char *line)
+{
+}
+#endif