chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8592551
)
[PATCH] trivial: remove _all_ trailing slashes with no_trailing_slash()
author
mbuesch@freenet.de
<mbuesch@freenet.de>
Sun, 6 Feb 2005 02:23:43 +0000
(
03:23
+0100)
committer
Greg KH
<gregkh@suse.de>
Wed, 27 Apr 2005 06:26:07 +0000
(23:26 -0700)
This changes no_trailing_slash() to remove all trailing slashes
and not just the last one.
udev_utils.c
patch
|
blob
|
history
diff --git
a/udev_utils.c
b/udev_utils.c
index 364037f7a98edf9f5e2ea267e57b09b422f79b81..5b0355d0e9986722d3b32f348ab9035a61b53ac0 100644
(file)
--- a/
udev_utils.c
+++ b/
udev_utils.c
@@
-200,11
+200,11
@@
size_t buf_get_line(const char *buf, size_t buflen, size_t cur)
void no_trailing_slash(char *path)
{
-
in
t len;
+
size_
t len;
len = strlen(path);
-
if
(len > 0 && path[len-1] == '/')
- path[
len-1
] = '\0';
+
while
(len > 0 && path[len-1] == '/')
+ path[
--len
] = '\0';
}
struct files {