diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2013-11-18 08:44:50 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2013-11-18 08:44:50 +0000 |
commit | 4cc10efa40984467840f0d8380415c45acc68c7a (patch) | |
tree | f9035dc4317c72f26a469136329646be02ad8e1e /Build/source/texk/seetexk | |
parent | 3727ee24040b6c00c121694a925988c49dac31dc (diff) |
dviselect: Remove dvi files with 0 pages and signal failure (from Akira)
git-svn-id: svn://tug.org/texlive/trunk@32175 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/seetexk')
-rw-r--r-- | Build/source/texk/seetexk/ChangeLog | 9 | ||||
-rw-r--r-- | Build/source/texk/seetexk/dviselect.c | 20 | ||||
-rwxr-xr-x | Build/source/texk/seetexk/seetexk.test | 11 | ||||
-rw-r--r-- | Build/source/texk/seetexk/tests/playnot.2 | 1 |
4 files changed, 35 insertions, 6 deletions
diff --git a/Build/source/texk/seetexk/ChangeLog b/Build/source/texk/seetexk/ChangeLog index 97dde57b734..5fe0971171e 100644 --- a/Build/source/texk/seetexk/ChangeLog +++ b/Build/source/texk/seetexk/ChangeLog @@ -1,3 +1,12 @@ +2013-11-18 Peter Breitenlohner <peb@mppmu.mpg.de> + + * seetexk.test: Add a test for dviselect creating 0 pages. + * tests/playnot.2 (new): Additional test output. + +2013-11-18 Akira Kakuto <kakuto@fuk.kindai.ac.jp> + + * dviselect.c: Remove dvi files with 0 pages. + 2013-07-01 Peter Breitenlohner <peb@mppmu.mpg.de> * dviselect.c, types.h: Replace bcopy(f, t, l) => diff --git a/Build/source/texk/seetexk/dviselect.c b/Build/source/texk/seetexk/dviselect.c index a8a2dc33f4b..e7c17d5846f 100644 --- a/Build/source/texk/seetexk/dviselect.c +++ b/Build/source/texk/seetexk/dviselect.c @@ -551,11 +551,21 @@ Usage: %s [-s] [-i infile] [-o outfile] pages [...] [infile [outfile]]\n", HandlePreAmble(); HandleDVIFile(); HandlePostAmble(); - if (!SFlag) - (void) fprintf(stderr, "\nWrote %d page%s, %ld bytes\n", - NumberOfOutputPages, NumberOfOutputPages == 1 ? "" : "s", - (long)CurrentPosition); - return 0; + if (NumberOfOutputPages > 0) { + if (!SFlag) + (void) fprintf(stderr, "\nWrote %d page%s, %ld bytes\n", + NumberOfOutputPages, NumberOfOutputPages == 1 ? "" : "s", + (long)CurrentPosition); + return 0; + } else { + if (!SFlag) + (void) fprintf(stderr, "Specified page may be out of range\n"); + if (outname) { + fclose (outf); + unlink (outname); + } + return 1; + } } static struct pagelist * diff --git a/Build/source/texk/seetexk/seetexk.test b/Build/source/texk/seetexk/seetexk.test index e9b02b4c2dd..41abfb8c576 100755 --- a/Build/source/texk/seetexk/seetexk.test +++ b/Build/source/texk/seetexk/seetexk.test @@ -1,9 +1,18 @@ #! /bin/sh -# Copyright (C) 2011 Peter Breitenlohner <tex-live@tug.org> +# Copyright (C) 2011-2013 Peter Breitenlohner <tex-live@tug.org> # You may freely use, modify and/or distribute this file. rm -rf play* +./dviselect =25 $srcdir/tests/play.dvi playsel.dvi \ + 2>playsel.2 \ + && exit 1 + test -r playsel.dvi \ + && exit 1 + diff playsel.2 $srcdir/tests/playnot.2 \ + || exit 1 + +rm -rf play* ./dviselect 15:25 $srcdir/tests/play.dvi playsel.dvi \ 2>playsel.2 \ && diff playsel.2 $srcdir/tests/playsel.2 \ diff --git a/Build/source/texk/seetexk/tests/playnot.2 b/Build/source/texk/seetexk/tests/playnot.2 new file mode 100644 index 00000000000..af49d2414ec --- /dev/null +++ b/Build/source/texk/seetexk/tests/playnot.2 @@ -0,0 +1 @@ +Specified page may be out of range |