diff options
author | Michael Vogt <mvo@debian.org> | 2013-10-02 10:15:52 +0200 |
---|---|---|
committer | Michael Vogt <mvo@debian.org> | 2013-10-02 10:15:52 +0200 |
commit | 75cd2506ce7ea411f7a0e888310d622ad330828c (patch) | |
tree | b6067f401a71636f0aa02c0142537f964e0fa273 /apt-pkg/contrib/strutl.cc | |
parent | a38e023c9d5a237ccae1755966adc7c0bbdb9d7e (diff) | |
parent | 2ddab3fb958518acbd26685eeeb7755106b721a3 (diff) |
Merge remote-tracking branch 'origin/bugfix/dpkg-progress-multiarch' into bugfix/dpkg-progress-multiarch
Diffstat (limited to 'apt-pkg/contrib/strutl.cc')
-rw-r--r-- | apt-pkg/contrib/strutl.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc index fd768f183..77e48962c 100644 --- a/apt-pkg/contrib/strutl.cc +++ b/apt-pkg/contrib/strutl.cc @@ -1120,11 +1120,9 @@ vector<string> VectorizeString(string const &haystack, char const &split) /*}}}*/ // StringSplit - split a string into a string vector by token /*{{{*/ // --------------------------------------------------------------------- -/* This can be used to split a given string up from a given string token - * into a vector of strings. A optional "maxsplit" argument can be used - * to limit the splitting, in this case the +/* See header for details. */ -vector<string> StringSplit(string const &s, std::string const &sep, +vector<string> StringSplit(std::string const &s, std::string const &sep, unsigned int maxsplit) { vector<string> split; @@ -1141,7 +1139,7 @@ vector<string> StringSplit(string const &s, std::string const &sep, split.push_back(s.substr(start, pos-start)); // if maxsplit is reached, the remaining string is the last item - if(maxsplit > 0 && split.size() >= maxsplit) + if(split.size() >= maxsplit) { split[split.size()-1] = s.substr(start); break; |