summary refs log tree commit diff
path: root/squeeze_slash.c
blob: b493cd14d9e34e95a8b516ad13e743bb177ff86e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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;
}