about summary refs log tree commit diff
path: root/mlist.c
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2020-04-30 23:27:39 +0200
committerLeah Neukirchen <leah@vuxu.org>2020-04-30 23:27:39 +0200
commite4e15bb4f0b818ba8e5d305ecae8258bb23c7030 (patch)
treec95d51c58f33154dcd27adaefbeb9a0b837d9552 /mlist.c
parentd83860c34e0fc4f4e00dbfce8bc9cdfa858ce234 (diff)
downloadmblaze-e4e15bb4f0b818ba8e5d305ecae8258bb23c7030.tar.gz
mblaze-e4e15bb4f0b818ba8e5d305ecae8258bb23c7030.tar.xz
mblaze-e4e15bb4f0b818ba8e5d305ecae8258bb23c7030.zip
mflag: list: don't clobber f when flags and -i is used
Diffstat (limited to 'mlist.c')
-rw-r--r--mlist.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/mlist.c b/mlist.c
index 65ed485..e03d7ba 100644
--- a/mlist.c
+++ b/mlist.c
@@ -72,14 +72,12 @@ list(char *prefix, char *file)
 			return;
 		icount++;
 		tcount++;
-		f += 3;
-		while (*f) {
-			if (flags[(unsigned int)*f] == -1)
+		char *g;
+		for (g = f + 3; *g; g++)
+			if (flags[(unsigned int)*g] == -1)
 				return;
-			if (flags[(unsigned int)*f] == 1)
+			else if (flags[(unsigned int)*g] == 1)
 				sum++;
-			f++;
-		}
 		if (sum != flagsum)
 			return;
 	}