summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/strutl.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2013-03-15 14:57:27 +0100
committerDavid Kalnischkies <kalnischkies@gmail.com>2013-03-15 14:57:27 +0100
commit4fb400a66f2436cba6c89cecdc9560c9b1c54337 (patch)
treedee96d7cac6ff01e130c1b617c84a1b312f21837 /apt-pkg/contrib/strutl.cc
parent39f38a81b85edf2e1bdc4e92267a63cc6c928734 (diff)
split out a method to strip whitespaces only on the right side
Diffstat (limited to 'apt-pkg/contrib/strutl.cc')
-rw-r--r--apt-pkg/contrib/strutl.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc
index ca096d736..9726138a0 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--);