projects
/
selector.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
46c2d7b
)
Automatic commit
author
Francois Fleuret
<francois@fleuret.org>
Wed, 11 Mar 2009 15:14:38 +0000
(16:14 +0100)
committer
Francois Fleuret
<francois@fleuret.org>
Wed, 11 Mar 2009 15:14:38 +0000
(16:14 +0100)
selector.cc
patch
|
blob
|
history
diff --git
a/selector.cc
b/selector.cc
index
a6eec47
..
4b41d07
100644
(file)
--- a/
selector.cc
+++ b/
selector.cc
@@
-264,13
+264,13
@@
int main(int argc, char **argv) {
curs_set(1);
endwin();
-
//
ofstream out("/tmp/selector.out");
-
// if(key == KEY_ENTER || key == '\n'
) {
-
// out << lines[highlighted_
line] << endl;
-
//
} else {
-
//
out << endl;
-
//
}
-
//
out.flush();
+ ofstream out("/tmp/selector.out");
+
if((key == KEY_ENTER || key == '\n') && line >= 0 && line < nb_lines
) {
+
out << lines[
line] << endl;
+ } else {
+ out << endl;
+ }
+ out.flush();
for(int l = 0; l < nb_lines; l++) {
delete[] lines[l];