]> Sergey Matveev's repositories - nnn.git/commitdiff
Fix #168
authorArun Prakash Jana <engineerarun@gmail.com>
Mon, 17 Dec 2018 12:35:36 +0000 (18:05 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Mon, 17 Dec 2018 12:35:36 +0000 (18:05 +0530)
src/nnn.c

index 175faed6fce1e2cbf115a1b46b30644dd9b7bc43..3bcdca224ec1472126c765855590f7b0d73d9895 100644 (file)
--- 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");