mblaze/squeeze_slash.c
2017-07-12 22:31:01 +02:00

16 lines
210 B
C

void
squeeze_slash(char *arg) {
char *s, *t;
// squeeze slashes
s = t = arg;
while ((*s++ = *t))
while (*t++ == '/' && *t == '/')
;
// remove trailing slashes
s--;
while (*--s == '/')
*s = 0;
}