+ // load deck object from input
+ deck_t *deck;
+ deck = markdown_load(input);
+
+ // close file
+ fclose(input);
+
+ // replace stdin with current tty if input was a pipe
+ // if input was a pipe reload is disabled, so we simply check that
+ if(noreload == 1) {
+ input = freopen("/dev/tty", "rw", stdin);
+ if(!input) {
+ fprintf(stderr, "%s: %s: %s\n", argv[0], "/dev/tty", strerror(errno));
+ exit(EXIT_FAILURE);
+ }
+ }