mblaze/squeeze_slash.c

16 lines
210 B
C
Raw Normal View History

2017-07-12 20:31:01 +00:00
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;
}