aboutsummaryrefslogtreecommitdiff
path: root/contrib/epee/src/readline_buffer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/epee/src/readline_buffer.cpp')
-rw-r--r--contrib/epee/src/readline_buffer.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/contrib/epee/src/readline_buffer.cpp b/contrib/epee/src/readline_buffer.cpp
index 68b739db9..d38afd296 100644
--- a/contrib/epee/src/readline_buffer.cpp
+++ b/contrib/epee/src/readline_buffer.cpp
@@ -39,7 +39,7 @@ rdln::suspend_readline::~suspend_readline()
}
rdln::readline_buffer::readline_buffer()
-: std::stringbuf()
+: std::stringbuf(), m_cout_buf(NULL)
{
current = this;
}
@@ -62,7 +62,7 @@ void rdln::readline_buffer::stop()
remove_line_handler();
}
-void rdln::readline_buffer::get_line(std::string& line)
+void rdln::readline_buffer::get_line(std::string& line) const
{
std::unique_lock<std::mutex> lock(line_mutex);
have_line.wait(lock);
@@ -122,7 +122,7 @@ static int process_input()
struct timeval t;
t.tv_sec = 0;
- t.tv_usec = 0;
+ t.tv_usec = 1000;
FD_ZERO(&fds);
FD_SET(STDIN_FILENO, &fds);
@@ -168,8 +168,11 @@ static int handle_enter(int x, int y)
}
free(line);
- rl_set_prompt(last_prompt.c_str());
- rl_redisplay();
+ if(last_line != "exit")
+ {
+ rl_set_prompt(last_prompt.c_str());
+ rl_redisplay();
+ }
rl_done = 1;
return 0;