projects
/
platform
/
upstream
/
rpm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5f0b82b
)
added stripTrailingSlashes()
author
ewt
<devnull@localhost>
Wed, 10 Jul 1996 02:33:54 +0000
(
02:33
+0000)
committer
ewt
<devnull@localhost>
Wed, 10 Jul 1996 02:33:54 +0000
(
02:33
+0000)
CVS patchset: 759
CVS date: 1996/07/10 02:33:54
lib/misc.c
patch
|
blob
|
history
lib/misc.h
patch
|
blob
|
history
diff --git
a/lib/misc.c
b/lib/misc.c
index
c23f147
..
38914cb
100644
(file)
--- 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
278ef2f
..
2dc8061
100644
(file)
--- 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);