aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2017-07-11 15:39:37 +0200
committerLeah Neukirchen <leah@vuxu.org>2017-07-11 15:39:37 +0200
commitaee4d6e8e59022b9632afe8e628b55351ffc3f7e (patch)
treea03fb0e9342f97a3d65108ddd6fd6aa363b7e7f4
parent011a13463f7dbeafad0e168c365dcda291083cf4 (diff)
downloadmblaze-aee4d6e8e59022b9632afe8e628b55351ffc3f7e.tar.gz
mlist: squeeze squeezing code
Thanks to quinq, who put all their heart in it.
-rw-r--r--mlist.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/mlist.c b/mlist.c
index 725a76d..8ad53f9 100644
--- a/mlist.c
+++ b/mlist.c
@@ -173,9 +173,8 @@ listarg(char *arg)
// squeeze slashes
s = t = arg;
while ((*s++ = *t))
- if (*t++ == '/')
- while (*t == '/')
- t++;
+ while (*t++ == '/' && *t == '/')
+ ;
// remove trailing slashes
s--;
while (*--s == '/')