diff options
author | John Wiegley <johnw@newartisans.com> | 2019-01-14 17:30:09 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-14 17:30:09 -0800 |
commit | bec7d3e82c52fd331d73bc9b2006e0ec86a23af9 (patch) | |
tree | 7d0c769098f5b69dd80b24c8a831d7255d70a71c /src | |
parent | 88fd3a38b9456998c59dd49bb225504156274c83 (diff) | |
parent | b29d07ac62a9e7df427ab71a789cfcc96de9f4db (diff) | |
download | fork-ledger-bec7d3e82c52fd331d73bc9b2006e0ec86a23af9.tar.gz fork-ledger-bec7d3e82c52fd331d73bc9b2006e0ec86a23af9.tar.bz2 fork-ledger-bec7d3e82c52fd331d73bc9b2006e0ec86a23af9.zip |
Merge pull request #1705 from scfc/move-have-edit
Use HAVE_EDIT only in main.cc
Diffstat (limited to 'src')
-rw-r--r-- | src/main.cc | 16 | ||||
-rw-r--r-- | src/system.hh.in | 6 |
2 files changed, 9 insertions, 13 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 625de6ad..c093e334 100644 --- a/src/system.hh.in +++ b/src/system.hh.in @@ -57,9 +57,9 @@ #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_EDIT #cmakedefine HAVE_GETPWUID #cmakedefine HAVE_GETPWNAM #cmakedefine HAVE_IOCTL @@ -164,10 +164,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> |