diff options
author | mbuesch@freenet.de <mbuesch@freenet.de> | 2005-02-06 03:23:43 +0100 |
---|---|---|
committer | Greg KH <gregkh@suse.de> | 2005-04-26 23:26:07 -0700 |
commit | e39515ac1fd303c0263ee4bc91f2d7699617d0bf (patch) | |
tree | 616b247ecc636927b46321a29a8091100b76e9df /udev_utils.c | |
parent | 85925517e67b85c94180b1de5e2cbd6a1c67c54c (diff) |
[PATCH] trivial: remove _all_ trailing slashes with no_trailing_slash()
This changes no_trailing_slash() to remove all trailing slashes
and not just the last one.
Diffstat (limited to 'udev_utils.c')
-rw-r--r-- | udev_utils.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/udev_utils.c b/udev_utils.c index 364037f7a9..5b0355d0e9 100644 --- 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) { - int 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 { |