summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main.cc16
-rw-r--r--src/system.hh.in8
2 files changed, 10 insertions, 14 deletions
diff --git a/src/main.cc b/src/main.cc
index c8b9ec3a..4348e8a6 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2018, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2019, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -35,6 +35,10 @@
// was moved there for the sake of clarity here
#include "session.h"
+#ifdef HAVE_EDIT
+#include <editline/readline.h>
+#endif
+
using namespace ledger;
#if HAVE_BOOST_PYTHON
@@ -128,13 +132,9 @@ int main(int argc, char * argv[], char * envp[])
bool exit_loop = false;
-#if HAVE_EDIT
-
+#ifdef HAVE_EDIT
rl_readline_name = const_cast<char *>("Ledger");
-#if 0
- // jww (2009-02-05): NYI
- rl_attempted_completion_function = ledger_completion;
-#endif
+ // TODO: rl_attempted_completion_function = ledger_completion;
while (char * p = readline(global_scope->prompt_string())) {
char * expansion = NULL;
@@ -173,7 +173,7 @@ int main(int argc, char * argv[], char * envp[])
global_scope->execute_command_wrapper(split_arguments(p), true);
}
-#if HAVE_EDIT
+#ifdef HAVE_EDIT
if (expansion)
std::free(expansion);
std::free(p);
diff --git a/src/system.hh.in b/src/system.hh.in
index 38ac1e63..3c1187d9 100644
--- a/src/system.hh.in
+++ b/src/system.hh.in
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2018, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2019, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -57,10 +57,10 @@
#define Ledger_VERSION_PRERELEASE "@Ledger_VERSION_PRERELEASE@"
#define Ledger_VERSION_DATE @Ledger_VERSION_DATE@
-#define HAVE_EDIT @HAVE_EDIT@
#define HAVE_GETTEXT @HAVE_GETTEXT@
#cmakedefine HAVE_ACCESS
+#cmakedefine HAVE_EDIT
#cmakedefine HAVE_REALPATH
#cmakedefine HAVE_GETPWUID
#cmakedefine HAVE_GETPWNAM
@@ -167,10 +167,6 @@ typedef std::ostream::pos_type ostream_pos_type;
#include <mpfr.h>
#include "utf8.h"
-#if HAVE_EDIT
-#include <editline/readline.h>
-#endif
-
#include <boost/algorithm/string.hpp>
#include <boost/any.hpp>
#include <boost/bind.hpp>