summary refs log tree commit diff
path: root/mlist.c
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2017-01-21 17:13:47 +0100
committerLeah Neukirchen <leah@vuxu.org>2017-01-21 17:13:47 +0100
commit0da278a9ad87848aaf012b084286916082333e93 (patch)
tree4685d8ad1b6f0c949eb6e549d8d8286aba16dbfd /mlist.c
parentb93b9303da2bc819d74b01b937300ee29f6323ff (diff)
downloadmblaze-0da278a9ad87848aaf012b084286916082333e93.tar.gz
mblaze-0da278a9ad87848aaf012b084286916082333e93.tar.xz
mblaze-0da278a9ad87848aaf012b084286916082333e93.zip
mlist: don't use blaze822_loop for the case when arguments are given
blaze822_loop replaces directory arguments with all cur/ mails, which is
not what we want in mlist.
Diffstat (limited to 'mlist.c')
-rw-r--r--mlist.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/mlist.c b/mlist.c
index 0f7bd88..4e40eb5 100644
--- a/mlist.c
+++ b/mlist.c
@@ -255,10 +255,14 @@ main(int argc, char *argv[])
 			flagsum++;
 	}
 
-	if (optind == argc && isatty(0))
-		goto usage;
-	else
-		blaze822_loop(argc-optind, argv+optind, listarg);
+	if (optind == argc) {
+		if (isatty(0))
+			goto usage;
+		blaze822_loop(0, 0, listarg);
+	} else {
+		for (i = optind; i < argc; i++)
+			listarg(argv[i]);
+	}
 
 	if (iflag && imatched)
 		printf("%6ld unseen  %3ld flagged  %6ld msg\n",