about summary refs log tree commit diff
path: root/mlist.c
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2017-07-12 22:31:01 +0200
committerLeah Neukirchen <leah@vuxu.org>2017-07-12 22:31:01 +0200
commit157542c3e7dd3eb89401bd3a8397693d4818efd8 (patch)
tree497baab029592636a4c53b50c5b01aae776e4b2a /mlist.c
parent73d80d80f98436aff9b3ce8b99089d5f909e7c63 (diff)
downloadmblaze-157542c3e7dd3eb89401bd3a8397693d4818efd8.tar.gz
mblaze-157542c3e7dd3eb89401bd3a8397693d4818efd8.tar.xz
mblaze-157542c3e7dd3eb89401bd3a8397693d4818efd8.zip
mlist: extract squeeze_slash
Diffstat (limited to 'mlist.c')
-rw-r--r--mlist.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/mlist.c b/mlist.c
index 8ad53f9..d796fc7 100644
--- a/mlist.c
+++ b/mlist.c
@@ -168,17 +168,7 @@ listdir(char *dir)
 void
 listarg(char *arg)
 {
-	char *s, *t;
-
-	// squeeze slashes
-	s = t = arg;
-	while ((*s++ = *t))
-		while (*t++ == '/' && *t == '/')
-			;
-	// remove trailing slashes
-	s--;
-	while (*--s == '/')
-		*s = 0;
+	squeeze_slash(arg);
 
 	struct stat st;
 	if (stat(arg, &st) < 0)