aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-02-12 01:27:18 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-02-12 01:39:19 +0000
commit166870dd9188fb3b55a3042100109de4abe4d471 (patch)
tree780047f48a37266146d688cfb904f2e8becb3cbb
parent5522cc551aaee176591b08546f368bb417c32f9e (diff)
downloadpaludis-166870dd9188fb3b55a3042100109de4abe4d471.tar.gz
paludis-166870dd9188fb3b55a3042100109de4abe4d471.tar.xz
Fix message handler
-rw-r--r--paludis/repositories/e/pipe_command_handler.cc14
1 files changed, 6 insertions, 8 deletions
diff --git a/paludis/repositories/e/pipe_command_handler.cc b/paludis/repositories/e/pipe_command_handler.cc
index 91ffc3c..0cd4c66 100644
--- a/paludis/repositories/e/pipe_command_handler.cc
+++ b/paludis/repositories/e/pipe_command_handler.cc
@@ -100,9 +100,13 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
}
else if (tokens[0] == "MESSAGE")
{
- if (tokens.size() != 4)
+ if (tokens.size() < 4)
{
Log::get_instance()->message("e.pipe_commands.message.bad", ll_warning, lc_context) << "Got bad MESSAGE pipe command";
+ return "Ebad MESSAGE command";
+ }
+ else
+ {
MessageType m;
if (tokens[2] == "einfo" || tokens[2] == "einfon")
m = mt_info;
@@ -116,13 +120,7 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
return "EUnknown message type " + tokens[2] + "";
if (maybe_output_manager)
- maybe_output_manager->message(m, tokens[3]);
- return "O0;";
- }
- else
- {
- Log::get_instance()->message("e.child.message", destringify<LogLevel>(tokens[2]), lc_context)
- << join(next(next(next(tokens.begin()))), tokens.end(), " ");
+ maybe_output_manager->message(m, join(next(next(next(tokens.begin()))), tokens.end(), " "));
return "O0;";
}
}