From d72696a16b81f6d6d08d4a8751db848fb5a8f29a Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Wed, 20 Jul 2016 15:39:24 +0200 Subject: msort: default to all messages when interactive w/o args --- msort.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'msort.c') 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); -- cgit 1.4.1