Commit Diff


commit - f4086c716b2f27f2f0e34157dcd64960589a3c9f
commit + 5ffbe221c75789cd2cdb37e1b20f1a575a20447f
blob - 51022b6090574aeb9224b976148c4f0a2979f53f
blob + df86e8d4e17b764a18770b42ad3f1995c6200707
--- tog/tog.c
+++ tog/tog.c
@@ -9809,7 +9809,8 @@ main(int argc, char *argv[])
 			fprintf(stderr, "%s: %s\n", getprogname(), error->msg);
 			return 1;
 		}
-	}
+	} else if (!isatty(STDIN_FILENO))
+		errx(1, "standard input is not a tty");
 
 #if !defined(PROFILE)
 	if (pledge("stdio rpath wpath cpath flock proc tty exec sendfd unveil",
@@ -9817,9 +9818,6 @@ main(int argc, char *argv[])
 		err(1, "pledge");
 #endif
 
-	if (!isatty(STDIN_FILENO))
-		errx(1, "standard input is not a tty");
-
 	while ((ch = getopt_long(argc, argv, "+hV", longopts, NULL)) != -1) {
 		switch (ch) {
 		case 'h':