From e90cc27a70431541c2d1d4affba771b37f69c388 Mon Sep 17 00:00:00 2001 From: Takuji Tanaka Date: Sun, 11 Jun 2017 14:50:50 +0000 Subject: 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 --- Build/source/texk/seetexk/ChangeLog | 5 +++++ Build/source/texk/seetexk/dvibook.c | 2 ++ Build/source/texk/seetexk/dviconcat.c | 4 ++++ Build/source/texk/seetexk/dviselect.c | 2 ++ Build/source/texk/seetexk/dvitodvi.c | 2 ++ 5 files changed, 15 insertions(+) (limited to 'Build') 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 + + * dvibook.c, dviconcat.c, dviselect.c, dvitodvi.c: + Show usage and exit if stdin is set to a keyboard. + 2015-10-05 Peter Breitenlohner * 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] [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) { -- cgit v1.2.3