mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-22 23:42:24 +00:00
Merge pull request #2103
21b939e1
readline: fix invalid memory access (moneromooo-monero)5f8f2905
readline_buffer: add a couple const (moneromooo-monero)
This commit is contained in:
commit
a0b494aa71
2 changed files with 4 additions and 4 deletions
|
@ -13,11 +13,11 @@ namespace rdln
|
||||||
void start();
|
void start();
|
||||||
void stop();
|
void stop();
|
||||||
int process();
|
int process();
|
||||||
bool is_running()
|
bool is_running() const
|
||||||
{
|
{
|
||||||
return m_cout_buf != NULL;
|
return m_cout_buf != NULL;
|
||||||
}
|
}
|
||||||
void get_line(std::string& line);
|
void get_line(std::string& line) const;
|
||||||
void set_prompt(const std::string& prompt);
|
void set_prompt(const std::string& prompt);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -39,7 +39,7 @@ rdln::suspend_readline::~suspend_readline()
|
||||||
}
|
}
|
||||||
|
|
||||||
rdln::readline_buffer::readline_buffer()
|
rdln::readline_buffer::readline_buffer()
|
||||||
: std::stringbuf()
|
: std::stringbuf(), m_cout_buf(NULL)
|
||||||
{
|
{
|
||||||
current = this;
|
current = this;
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ void rdln::readline_buffer::stop()
|
||||||
remove_line_handler();
|
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);
|
std::unique_lock<std::mutex> lock(line_mutex);
|
||||||
have_line.wait(lock);
|
have_line.wait(lock);
|
||||||
|
|
Loading…
Reference in a new issue