summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/strutl.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2013-04-30 10:44:16 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2013-04-30 10:44:16 +0200
commit3599bca5211077f5456a40adb5cec1bcbee8c3ae (patch)
tree221627b7ef4e3d6d294fbaaab425f2400734bd93 /apt-pkg/contrib/strutl.cc
parent6029901a2cf49aac035590960d84572b56f28933 (diff)
parentb5595da902e62af7c295f1603ae5b43ba4cef281 (diff)
merged from the debian-sid branch
Diffstat (limited to 'apt-pkg/contrib/strutl.cc')
-rw-r--r--apt-pkg/contrib/strutl.cc16
1 files changed, 11 insertions, 5 deletions
diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc
index df11a80ad..64731b482 100644
--- a/apt-pkg/contrib/strutl.cc
+++ b/apt-pkg/contrib/strutl.cc
@@ -117,7 +117,13 @@ char *_strstrip(char *String)
if (*String == 0)
return String;
-
+ return _strrstrip(String);
+}
+ /*}}}*/
+// strrstrip - Remove white space from the back of a string /*{{{*/
+// ---------------------------------------------------------------------
+char *_strrstrip(char *String)
+{
char *End = String + strlen(String) - 1;
for (;End != String - 1 && (*End == ' ' || *End == '\t' || *End == '\n' ||
*End == '\r'); End--);
@@ -1247,7 +1253,7 @@ string StripEpoch(const string &VerStr)
return VerStr;
return VerStr.substr(i+1);
}
-
+ /*}}}*/
// tolower_ascii - tolower() function that ignores the locale /*{{{*/
// ---------------------------------------------------------------------
/* This little function is the most called method we have and tries
@@ -1285,14 +1291,14 @@ bool CheckDomainList(const string &Host,const string &List)
return false;
}
/*}}}*/
-// DeEscapeString - unescape (\0XX and \xXX) from a string /*{{{*/
+// DeEscapeString - unescape (\0XX and \xXX) from a string /*{{{*/
// ---------------------------------------------------------------------
/* */
string DeEscapeString(const string &input)
{
char tmp[3];
- string::const_iterator it, escape_start;
- string output, octal, hex;
+ string::const_iterator it;
+ string output;
for (it = input.begin(); it != input.end(); ++it)
{
// just copy non-escape chars