about summary refs log tree commit diff
path: root/mshow.c
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-07-23 00:18:05 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-07-23 00:25:18 +0200
commit6c1e0d8d5692dc71ecbcbfa5608f6a1d6e4b88ca (patch)
tree08d79b31a63526ec4d22778973fe8e90c496a6b8 /mshow.c
parent8817e71e64f8c95459fb5fc9075f2970b835d0dd (diff)
downloadmblaze-6c1e0d8d5692dc71ecbcbfa5608f6a1d6e4b88ca.tar.gz
mblaze-6c1e0d8d5692dc71ecbcbfa5608f6a1d6e4b88ca.tar.xz
mblaze-6c1e0d8d5692dc71ecbcbfa5608f6a1d6e4b88ca.zip
seq: add blaze822_loop1 for easier argument overriding
Diffstat (limited to 'mshow.c')
-rw-r--r--mshow.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/mshow.c b/mshow.c
index b0be711..5715d5f 100644
--- a/mshow.c
+++ b/mshow.c
@@ -539,12 +539,10 @@ main(int argc, char *argv[])
 	} else if (Oflag) { // extract to stdout
 		extract(Oflag, argc-optind, argv+optind, 1);
 	} else if (tflag) { // list
-		if (argc == optind && isatty(0)) {
-			char *cur[] = { "." };
-			blaze822_loop(1, cur, list);
-		} else {
+		if (argc == optind && isatty(0))
+			blaze822_loop1(".", list);
+		else
 			blaze822_loop(argc-optind, argv+optind, list);
-		}
 	} else if (Rflag) { // render for reply
 		blaze822_loop(argc-optind, argv+optind, reply);
 	} else { // show
@@ -555,12 +553,10 @@ main(int argc, char *argv[])
 			if (f)
 				filters = blaze822(f);
 		}
-		if (argc == optind && isatty(0)) {
-			char *cur[] = { "." };
-			blaze822_loop(1, cur, show);
-		} else {
+		if (argc == optind && isatty(0))
+			blaze822_loop1(".", show);
+		else
 			blaze822_loop(argc-optind, argv+optind, show);
-		}
 		if (!nflag) // don't set cur
 			blaze822_seq_setcur(newcur);
 	}