Przeglądaj źródła

Don't use printerr() before curses has been initialized

master
sin 9 lat temu
rodzic
commit
013bcdee35
1 zmienionych plików z 9 dodań i 5 usunięć
  1. +9
    -5
      noice.c

+ 9
- 5
noice.c Wyświetl plik

@@ -885,8 +885,10 @@ main(int argc, char *argv[])
char *ifilter; char *ifilter;


/* Confirm we are in a terminal */ /* Confirm we are in a terminal */
if (!isatty(STDIN_FILENO)) if (!isatty(0) || !isatty(1)) {
printerr(1, "isatty"); fprintf(stderr, "stdin or stdout is not a tty\n");
exit(1);
}


if (getuid() == 0) if (getuid() == 0)
ifilter = "."; ifilter = ".";
@@ -904,8 +906,10 @@ main(int argc, char *argv[])
signal(SIGINT, SIG_IGN); signal(SIGINT, SIG_IGN);


/* Test initial path */ /* Test initial path */
if (canopendir(ipath) == 0) if (canopendir(ipath) == 0) {
printerr(1, ipath); fprintf(stderr, "%s: %s\n", ipath, strerror(errno));
exit(1);
}


/* Set locale before curses setup */ /* Set locale before curses setup */
setlocale(LC_ALL, ""); setlocale(LC_ALL, "");
@@ -916,5 +920,5 @@ main(int argc, char *argv[])


exitcurses(); exitcurses();


return 0; exit(0);
} }

||||||
x
 
000:0
Ładowanie…
Anuluj
Zapisz