summaryrefslogtreecommitdiff
path: root/Build/source/texk/seetexk/dviconcat.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/seetexk/dviconcat.c')
-rw-r--r--Build/source/texk/seetexk/dviconcat.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/Build/source/texk/seetexk/dviconcat.c b/Build/source/texk/seetexk/dviconcat.c
index 18e3c14c890..f3a035b931b 100644
--- a/Build/source/texk/seetexk/dviconcat.c
+++ b/Build/source/texk/seetexk/dviconcat.c
@@ -42,6 +42,9 @@
extern char *optarg;
extern int optind;
#endif
+#if defined(WIN32)
+#include <sys/stat.h>
+#endif
#include "types.h"
#include "dviclass.h"
@@ -467,6 +470,16 @@ usage:
* We write a preamble based on the first input file.
*/
if (optind >= argc) {
+#if defined(WIN32)
+ if (outf == stdout) {
+ struct stat sti, sto;
+ int fdi = fileno(stdin), fdo = fileno(stdout);
+ if (isatty(fdi) == 0 && fstat(fdi, &sti) == 0 && S_ISFIFO(sti.st_mode)
+ && isatty(fdo) == 0 && fstat(fdo, &sto) == 0 && S_ISFIFO(sto.st_mode)) {
+ goto usage;
+ }
+ }
+#endif
if (!isatty(fileno(stdin)))
SET_BINARY(fileno(stdin));
else