summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakuji Tanaka <KXD02663@nifty.ne.jp>2017-06-11 14:50:50 +0000
committerTakuji Tanaka <KXD02663@nifty.ne.jp>2017-06-11 14:50:50 +0000
commite90cc27a70431541c2d1d4affba771b37f69c388 (patch)
tree1fd5ff55f44b1c5cf96a943b374c9011f10d6e73
parent8cada474755655a7cb468072de2ad1ab9f10a78e (diff)
texk/seetexk: Show usage and exit if stdin is set to a keyboard
git-svn-id: svn://tug.org/texlive/trunk@44561 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/texk/seetexk/ChangeLog5
-rw-r--r--Build/source/texk/seetexk/dvibook.c2
-rw-r--r--Build/source/texk/seetexk/dviconcat.c4
-rw-r--r--Build/source/texk/seetexk/dviselect.c2
-rw-r--r--Build/source/texk/seetexk/dvitodvi.c2
5 files changed, 15 insertions, 0 deletions
diff --git a/Build/source/texk/seetexk/ChangeLog b/Build/source/texk/seetexk/ChangeLog
index 980f0f6ff36..962a2fbf06c 100644
--- a/Build/source/texk/seetexk/ChangeLog
+++ b/Build/source/texk/seetexk/ChangeLog
@@ -1,3 +1,8 @@
+2017-06-11 TANAKA Takuji <ttk@t-lab.opal.ne.jp>
+
+ * dvibook.c, dviconcat.c, dviselect.c, dvitodvi.c:
+ Show usage and exit if stdin is set to a keyboard.
+
2015-10-05 Peter Breitenlohner <peb@mppmu.mpg.de>
* dvitodvi.c (ParseSpecs): Avoid to return the address of a
diff --git a/Build/source/texk/seetexk/dvibook.c b/Build/source/texk/seetexk/dvibook.c
index 80a16e1266c..747952c1657 100644
--- a/Build/source/texk/seetexk/dvibook.c
+++ b/Build/source/texk/seetexk/dvibook.c
@@ -446,6 +446,8 @@ Usage: %s [-s signature] [-q] [-i infile] [-o outfile] [infile [outfile]]\n",
inf = stdin;
if (!isatty(fileno(inf)))
SET_BINARY(fileno(inf));
+ else
+ goto usage;
} else if ((inf = fopen(DVIFileName, FOPEN_RBIN_MODE)) == 0)
error(1, -1, "cannot read %s", DVIFileName);
if (outname == NULL) {
diff --git a/Build/source/texk/seetexk/dviconcat.c b/Build/source/texk/seetexk/dviconcat.c
index d776e57a3b5..dad528e4806 100644
--- a/Build/source/texk/seetexk/dviconcat.c
+++ b/Build/source/texk/seetexk/dviconcat.c
@@ -437,6 +437,8 @@ usage:
if (optind >= argc) {
if (!isatty(fileno(stdin)))
SET_BINARY(fileno(stdin));
+ else
+ goto usage;
doit("`stdin'", stdin);
}
else {
@@ -445,6 +447,8 @@ usage:
if (*s == '-' && s[1] == 0) {
if (!isatty(fileno(stdin)))
SET_BINARY(fileno(stdin));
+ else
+ goto usage;
doit("`stdin'", stdin);
}
else if ((f = fopen(s, FOPEN_RBIN_MODE)) == NULL) {
diff --git a/Build/source/texk/seetexk/dviselect.c b/Build/source/texk/seetexk/dviselect.c
index 6e55ab7a330..5f8a79d9aa7 100644
--- a/Build/source/texk/seetexk/dviselect.c
+++ b/Build/source/texk/seetexk/dviselect.c
@@ -575,6 +575,8 @@ Usage: %s [-s] [-i infile] [-o outfile] pages [...] [infile [outfile]]\n",
inf = stdin;
if (!isatty(fileno(inf)))
SET_BINARY(fileno(inf));
+ else
+ goto usage;
} else if ((inf = fopen(DVIFileName, FOPEN_RBIN_MODE)) == 0)
error(1, -1, "cannot read %s", DVIFileName);
diff --git a/Build/source/texk/seetexk/dvitodvi.c b/Build/source/texk/seetexk/dvitodvi.c
index e081fc3a0cf..deffc3146bd 100644
--- a/Build/source/texk/seetexk/dvitodvi.c
+++ b/Build/source/texk/seetexk/dvitodvi.c
@@ -688,6 +688,8 @@ Usage: %s [-q] [-i infile] [-o outfile] [-w width] [-h height] <pagespecs> [infi
inf = stdin;
if (!isatty(fileno(inf)))
SET_BINARY(fileno(inf));
+ else
+ goto usage;
} else if ((inf = fopen(DVIFileName, FOPEN_RBIN_MODE)) == 0)
error(1, -1, "cannot read %s", DVIFileName);
if (outname == NULL) {