aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2018-12-17 18:05:36 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2018-12-17 18:05:36 +0530
commit9eec60f8b1400dfd00a27bd53d0f9131ecdd4f55 (patch)
treed716c07a3ae38d4bddca08111ad568d44b947094
parent5548990b8f1622d2ae921d3729cc6f3885368294 (diff)
downloadnnn-9eec60f8b1400dfd00a27bd53d0f9131ecdd4f55.tar.gz
Fix #168
-rw-r--r--src/nnn.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 175faed..3bcdca2 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -3548,12 +3548,6 @@ int main(int argc, char *argv[])
char *ipath = NULL;
int opt;
- /* Confirm we are in a terminal */
- if (!isatty(0) || !isatty(1)) {
- fprintf(stderr, "stdin or stdout is not a tty\n");
- return 1;
- }
-
while ((opt = getopt(argc, argv, "Slib:Cep:vh")) != -1) {
switch (opt) {
case 'S':
@@ -3602,6 +3596,12 @@ int main(int argc, char *argv[])
}
}
+ /* Confirm we are in a terminal */
+ if (!isatty(0) || !isatty(1)) {
+ fprintf(stderr, "stdin or stdout is not a tty\n");
+ return 1;
+ }
+
/* Get the context colors; copier used as tmp var */
if (cfg.showcolor) {
copier = getenv("NNN_CONTEXT_COLORS");