소스 검색

criss-cross merge with my sid branch

David Kalnischkies 16 년 전
부모
커밋
fc04d4b48a
2개의 변경된 파일12개의 추가작업 그리고 11개의 파일을 삭제
  1. 11 10
      apt-pkg/contrib/strutl.cc
  2. 1 1
      apt-pkg/contrib/strutl.h

+ 11 - 10
apt-pkg/contrib/strutl.cc

@@ -1005,16 +1005,17 @@ bool TokSplitString(char Tok,char *Input,char **List,
 /* This can be used to split a given string up into a vector, so the
    propose is the same as in the method above and this one is a bit slower
    also, but the advantage is that we an iteratable vector */
-vector<string> ExplodeString(string const &haystack, char const &split) {
-	string::const_iterator start = haystack.begin();
-	string::const_iterator end = start;
-	vector<string> exploded;
-	do {
-		for (; end != haystack.end() && *end != split; ++end);
-		exploded.push_back(string(start, end));
-		start = end + 1;
-	} while (end != haystack.end() && (++end) != haystack.end());
-	return exploded;
+vector<string> ExplodeString(string const &haystack, char const &split)
+{
+   string::const_iterator start = haystack.begin();
+   string::const_iterator end = start;
+   vector<string> exploded;
+   do {
+      for (; end != haystack.end() && *end != split; ++end);
+      exploded.push_back(string(start, end));
+      start = end + 1;
+   } while (end != haystack.end() && (++end) != haystack.end());
+   return exploded;
 }
 									/*}}}*/
 // RegexChoice - Simple regex list/list matcher				/*{{{*/

+ 1 - 1
apt-pkg/contrib/strutl.h

@@ -59,7 +59,7 @@ bool StrToNum(const char *Str,unsigned long &Res,unsigned Len,unsigned Base = 0)
 bool Hex2Num(const string &Str,unsigned char *Num,unsigned int Length);
 bool TokSplitString(char Tok,char *Input,char **List,
 		    unsigned long ListMax);
-vector<string> ExplodeString(string const &haystack, char const &split=',');
+vector<string> ExplodeString(string const &haystack, char const &split);
 void ioprintf(ostream &out,const char *format,...) APT_FORMAT2;
 void strprintf(string &out,const char *format,...) APT_FORMAT2;
 char *safe_snprintf(char *Buffer,char *End,const char *Format,...) APT_FORMAT3;