aboutsummaryrefslogtreecommitdiff
path: root/contrib/epee/include/console_handler.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/epee/include/console_handler.h')
-rw-r--r--contrib/epee/include/console_handler.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/contrib/epee/include/console_handler.h b/contrib/epee/include/console_handler.h
index 952fc3c96..5dd3eaba9 100644
--- a/contrib/epee/include/console_handler.h
+++ b/contrib/epee/include/console_handler.h
@@ -274,14 +274,15 @@ namespace epee
}
std::string command;
- if(!m_stdin_reader.get_line(command))
- {
- LOG_PRINT("Failed to read line.", LOG_LEVEL_0);
- }
+ bool get_line_ret = m_stdin_reader.get_line(command);
if (m_stdin_reader.eos())
{
break;
}
+ if (!get_line_ret)
+ {
+ LOG_PRINT("Failed to read line.", LOG_LEVEL_0);
+ }
string_tools::trim(command);
LOG_PRINT_L2("Read command: " << command);
@@ -303,7 +304,8 @@ namespace epee
std::cout << usage;
}
}
- exit_handler();
+ if (exit_handler)
+ exit_handler();
return true;
CATCH_ENTRY_L0("console_handler", false);
}