projects
/
selector.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2e8b792
)
Added a test to check we do have a tty (and not a pipe in).
author
Francois Fleuret
<francois@fleuret.org>
Tue, 17 Mar 2009 19:31:00 +0000
(20:31 +0100)
committer
Francois Fleuret
<francois@fleuret.org>
Tue, 17 Mar 2009 19:31:00 +0000
(20:31 +0100)
selector.cc
patch
|
blob
|
history
diff --git
a/selector.cc
b/selector.cc
index
9dafd4d
..
cfb583e
100644
(file)
--- a/
selector.cc
+++ b/
selector.cc
@@
-388,6
+388,12
@@
void update_screen(int *current_line, int *temporary_line, int motion,
//////////////////////////////////////////////////////////////////////
int main(int argc, char **argv) {
+
+ if(!ttyname(STDIN_FILENO)) {
+ cerr << "Error: the standard input is not a tty." << endl;
+ exit(1);
+ }
+
char buffer[buffer_size];
int color_fg_modeline, color_bg_modeline;
int color_fg_highlight, color_bg_highlight;