aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-02-16 19:08:40 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-02-16 19:08:40 +0000
commita6fbf925146cfbe10470eba50227f30991edbf1e (patch)
tree67e4dd46a5a7e3e7f88ac3e3dc3a8805bd202c27
parent43e28d7cb6db07b0e4bd2d7085666446477f0264 (diff)
downloadpaludis-a6fbf925146cfbe10470eba50227f30991edbf1e.tar.gz
paludis-a6fbf925146cfbe10470eba50227f30991edbf1e.tar.xz
Don't break the upgrade path, and don't discard empty pipe items
-rw-r--r--paludis/repositories/e/pipe_command_handler.cc15
1 files changed, 14 insertions, 1 deletions
diff --git a/paludis/repositories/e/pipe_command_handler.cc b/paludis/repositories/e/pipe_command_handler.cc
index 612a113..d7356fc 100644
--- a/paludis/repositories/e/pipe_command_handler.cc
+++ b/paludis/repositories/e/pipe_command_handler.cc
@@ -67,7 +67,20 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
try
{
std::vector<std::string> tokens;
- tokenise<delim_kind::AnyOfTag, delim_mode::DelimiterTag>(s, stringify('\2'), "", std::back_inserter(tokens));
+ if (std::string::npos == s.find('\2'))
+ tokenise_whitespace(s, std::back_inserter(tokens));
+ else
+ {
+ std::string t(s);
+ std::string::size_type p(t.find('\2'));
+ while (std::string::npos != p)
+ {
+ tokens.push_back(t.substr(0, p));
+ t.erase(0, p + 1);
+ p = t.find('\2');
+ }
+ }
+
if (tokens.empty())
{
Log::get_instance()->message("e.pipe_commands.empty", ll_warning, lc_context) << "Got empty pipe command";