summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorewt <devnull@localhost>1996-07-10 02:33:54 +0000
committerewt <devnull@localhost>1996-07-10 02:33:54 +0000
commit3685015232cf8870ff32f30e1e446e52809651c0 (patch)
treee88ae20247f6c30a3c4e8ee58fcd0de09c141fc7 /lib
parent5f0b82b4f575d3e23b541b68899cfb4db9ddc76a (diff)
downloadrpm-3685015232cf8870ff32f30e1e446e52809651c0.tar.gz
rpm-3685015232cf8870ff32f30e1e446e52809651c0.tar.bz2
rpm-3685015232cf8870ff32f30e1e446e52809651c0.zip
added stripTrailingSlashes()
CVS patchset: 759 CVS date: 1996/07/10 02:33:54
Diffstat (limited to 'lib')
-rw-r--r--lib/misc.c10
-rw-r--r--lib/misc.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/lib/misc.c b/lib/misc.c
index c23f14717..38914cbfe 100644
--- a/lib/misc.c
+++ b/lib/misc.c
@@ -251,3 +251,13 @@ int vercmp(char * one, char * two) {
if (!*one) return -1; else return 1;
}
+
+void stripTrailingSlashes(char * str) {
+ char * chptr;
+
+ chptr = str + strlen(str) - 1;
+ while (*chptr == '/' && chptr >= str) {
+ *chptr = '\0';
+ chptr--;
+ }
+}
diff --git a/lib/misc.h b/lib/misc.h
index 278ef2f3c..2dc806101 100644
--- a/lib/misc.h
+++ b/lib/misc.h
@@ -3,6 +3,7 @@
char ** splitString(char * str, int length, char sep);
void freeSplitString(char ** list);
+void stripTrailingSlashes(char * str);
int exists(char * filespec);