pinosaur
/
smdp.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
remove duplicated code
[smdp.git]
/
mdp.c
diff --git
a/mdp.c
b/mdp.c
index
d641faa
..
4e37879
100644
(file)
--- a/
mdp.c
+++ b/
mdp.c
@@
-1,5
+1,5
@@
/*
/*
- * m
pd
-- A command-line based markdown presentation tool.
+ * m
dp
-- A command-line based markdown presentation tool.
* Copyright (C) 2014 Michael Goehler
*
* This program is free software: you can redistribute it and/or modify
* Copyright (C) 2014 Michael Goehler
*
* This program is free software: you can redistribute it and/or modify
@@
-104,6
+104,10
@@
int main(int argc, char *argv[]) {
// close file
fclose(input);
// 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);
}
if(debug > 0) {
markdown_debug(deck, debug);
}