pinosaur
/
smdp.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ecc66f8
)
moved file handling to mdp.c completely
author
Michael Göhler
<somebody.here@gmx.de>
Wed, 17 Sep 2014 20:46:41 +0000
(22:46 +0200)
committer
Michael Göhler
<somebody.here@gmx.de>
Wed, 17 Sep 2014 20:46:41 +0000
(22:46 +0200)
mdp.c
patch
|
blob
|
history
viewer.c
patch
|
blob
|
history
diff --git
a/mdp.c
b/mdp.c
index
9a71cd0
..
4e37879
100644
(file)
--- a/
mdp.c
+++ b/
mdp.c
@@
-104,6
+104,10
@@
int main(int argc, char *argv[]) {
// close file
fclose(input);
+ // replace stdin with current tty if input was a pipe
+ if(input == stdin)
+ freopen("/dev/tty", "rw", stdin);
+
if(debug > 0) {
markdown_debug(deck, debug);
}
diff --git
a/viewer.c
b/viewer.c
index
5fedbf7
..
a97e44d
100644
(file)
--- a/
viewer.c
+++ b/
viewer.c
@@
-81,9
+81,6
@@
int ncurses_display(deck_t *deck, int notrans, int nofade) {
// set locale to display UTF-8 correctly in ncurses
setlocale(LC_CTYPE, "");
- // replace stdin with current tty if markdown input was piped
- freopen("/dev/tty", "rw", stdin);
-
// init ncurses
initscr();