about summary refs log tree commit diff
path: root/msort.c
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-07-20 15:39:24 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-07-20 15:39:24 +0200
commitd72696a16b81f6d6d08d4a8751db848fb5a8f29a (patch)
tree9d3f7c1ae5b799dfeb3f4d07d3033900b41b4bf6 /msort.c
parent6dc9eeb050224f5a691bf553baecd1ac35608923 (diff)
downloadmblaze-d72696a16b81f6d6d08d4a8751db848fb5a8f29a.tar.gz
mblaze-d72696a16b81f6d6d08d4a8751db848fb5a8f29a.tar.xz
mblaze-d72696a16b81f6d6d08d4a8751db848fb5a8f29a.zip
msort: default to all messages when interactive w/o args
Diffstat (limited to 'msort.c')
-rw-r--r--msort.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/msort.c b/msort.c
index 42459e5..e1bd70d 100644
--- a/msort.c
+++ b/msort.c
@@ -275,9 +275,10 @@ add(char *file)
 int
 main(int argc, char *argv[])
 {
+	int c, i;
+
 	sortorder = idxorder;
 
-	int c;
 	while ((c = getopt(argc, argv, "fdsFMSr")) != -1)
 		switch(c) {
 		case 'f': sortorder = fromorder; break;
@@ -297,7 +298,12 @@ main(int argc, char *argv[])
 	if (!mails)
 		exit(-1);
 
-	int i = blaze822_loop(argc-optind, argv+optind, add);
+	if (argc == optind && isatty(0)) {
+		char *all[] = { ":" };
+		blaze822_loop(1, all, add);
+	} else {
+		blaze822_loop(argc-optind, argv+optind, add);
+	}
 
 	qsort(mails, idx, sizeof (struct mail), sortorder);