Fix editor not displaying an error when stdio is not a terminal.

This commit is contained in:
Jonas 'Sortie' Termansen 2014-05-13 23:18:02 +02:00
parent 0c48dfca96
commit 6f35797e19
1 changed files with 5 additions and 0 deletions

View File

@ -2225,6 +2225,11 @@ void editor_kbkey(struct editor* editor, int kbkey)
int main(int argc, char* argv[])
{
if ( !isatty(0) )
error(1, errno, "standard input");
if ( !isatty(1) )
error(1, errno, "standard output");
struct editor editor;
initialize_editor(&editor);