From aee4d6e8e59022b9632afe8e628b55351ffc3f7e Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Tue, 11 Jul 2017 15:39:37 +0200 Subject: mlist: squeeze squeezing code Thanks to quinq, who put all their heart in it. --- mlist.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'mlist.c') 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 == '/') -- cgit 1.4.1