mirror of
https://github.com/AuxXxilium/eudev.git
synced 2024-12-28 06:35:34 +07:00
[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.
This commit is contained in:
parent
85925517e6
commit
e39515ac1f
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user