From 6f35797e1957142f839c4eaa2e27469c6911667b Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Tue, 13 May 2014 23:18:02 +0200 Subject: [PATCH] Fix editor not displaying an error when stdio is not a terminal. --- utils/editor.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/utils/editor.cpp b/utils/editor.cpp index 5735176c..d655ddc1 100644 --- a/utils/editor.cpp +++ b/utils/editor.cpp @@ -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);