This commit is contained in:
Arun Prakash Jana 2018-12-17 18:05:36 +05:30
parent 5548990b8f
commit 9eec60f8b1
No known key found for this signature in database
GPG key ID: A75979F35C080412

View file

@ -3548,12 +3548,6 @@ int main(int argc, char *argv[])
char *ipath = NULL; char *ipath = NULL;
int opt; 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) { while ((opt = getopt(argc, argv, "Slib:Cep:vh")) != -1) {
switch (opt) { switch (opt) {
case 'S': 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 */ /* Get the context colors; copier used as tmp var */
if (cfg.showcolor) { if (cfg.showcolor) {
copier = getenv("NNN_CONTEXT_COLORS"); copier = getenv("NNN_CONTEXT_COLORS");