diff --git a/src/libwrapper.cpp b/src/libwrapper.cpp index 95e8192..ddc35b0 100644 --- a/src/libwrapper.cpp +++ b/src/libwrapper.cpp @@ -22,9 +22,11 @@ # include "config.h" #endif -#include #include #include +#include + +#include #include "utils.hpp" @@ -348,25 +350,21 @@ bool Library::process_phrase(const char *loc_str, read_line &io, bool force) utf8_output ? res_list[i].def.c_str() : loc_def.c_str()); } int choise; + std::auto_ptr choice_readline(create_readline_object()); for (;;) { string str_choise; - printf(_("Your choice[-1 to abort]: ")); - - if(!stdio_getline(stdin, str_choise)){ - putchar('\n'); - exit(EXIT_SUCCESS); - } + choice_readline->read(_("Your choice[-1 to abort]: "), str_choise); sscanf(str_choise.c_str(), "%d", &choise); if (choise>=0 && choise