aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2017-09-01 17:34:36 +0200
committerLeah Neukirchen <leah@vuxu.org>2017-09-01 17:34:36 +0200
commit3bfd9319e9e7385f97d5a32e36bb53890731b110 (patch)
tree6e411189c310c150e319a505f31e05894be0d9ae
parent66d0eff12fdf31e520493e7c2accb95410dcaec2 (diff)
downloadmblaze-3bfd9319e9e7385f97d5a32e36bb53890731b110.tar.gz
mflag: fix behavior with no arguments and reading from not a tty
-rw-r--r--mflag.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/mflag.c b/mflag.c
index 687ea6e..a5a6005 100644
--- a/mflag.c
+++ b/mflag.c
@@ -138,6 +138,11 @@ main(int argc, char *argv[])
curfile = blaze822_seq_cur();
if (vflag) {
+ if (argc == optind && !isatty(0)) {
+ blaze822_loop(0, 0, flag); // read from stdin
+ return 0;
+ }
+
args = calloc(sizeof (char *), argsalloc);
if (!args)
exit(-1);