From 2c396c31d4fa5268218d1e1607837b156cd1dc1f Mon Sep 17 00:00:00 2001 From: Akira Kakuto Date: Tue, 21 Mar 2017 05:09:36 +0000 Subject: dvipsk: show information and exit if options --version or --help are found git-svn-id: svn://tug.org/texlive/trunk@43565 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/dvipsk/ChangeLog | 6 ++++++ Build/source/texk/dvipsk/dvips.c | 40 ++++++++++++++++++++++---------------- 2 files changed, 29 insertions(+), 17 deletions(-) (limited to 'Build/source') diff --git a/Build/source/texk/dvipsk/ChangeLog b/Build/source/texk/dvipsk/ChangeLog index a401268af28..1f435caaea2 100644 --- a/Build/source/texk/dvipsk/ChangeLog +++ b/Build/source/texk/dvipsk/ChangeLog @@ -1,3 +1,9 @@ +2017-03-21 Akira Kakuto + + * dvips.c: Show information and exit if dvips finds options + --help or --version. Report from Igor Liferenko: + http://tug.org/pipermail/tex-k/2017-March/002748.html + 2017-03-18 Karl Berry * configure.ac, diff --git a/Build/source/texk/dvipsk/dvips.c b/Build/source/texk/dvipsk/dvips.c index 87b6e0bfa1b..a823705480f 100644 --- a/Build/source/texk/dvipsk/dvips.c +++ b/Build/source/texk/dvipsk/dvips.c @@ -663,21 +663,6 @@ main(int argc, char **argv) #endif /* DEBUG */ #ifdef KPATHSEA if (argc > 1) { - if (strcmp (argv[1], "--help") == 0) { - help (0); - exit (0); - } else if (strcmp (argv[1], "--version") == 0) { - puts (BANNER); - puts (kpathsea_version_string); - puts ("Copyright 2017 Radical Eye Software.\n\ -There is NO warranty. You may redistribute this software\n\ -under the terms of the GNU General Public License\n\ -and the Dvips copyright.\n\ -For more information about these matters, see the files\n\ -named COPYING and dvips.h.\n\ -Primary author of Dvips: T. Rokicki."); - exit (0); - } if (argc == 2 && strncmp(argv[1], "-?", 2) == 0) { printf("%s %s\n", banner, banner2); help(0); @@ -688,8 +673,8 @@ Primary author of Dvips: T. Rokicki."); exit(0); } } -#endif -#endif +#endif /* KPATHSEA */ +#endif /* VMS */ dvips_debug_flag = 0; { /* for compilers incompatible with c99 */ char *s = getenv ("DVIPSDEBUG"); @@ -724,6 +709,27 @@ Primary author of Dvips: T. Rokicki."); if (*argv[i]=='-') { char *p=argv[i]+2; char c=argv[i][1]; +#ifdef KPATHSEA + /* print information and exit if dvips finds options + --help or --version */ + if (strlen (argv[i] + 1) == 5 && strcmp (argv[i] + 1, "-help") == 0) { + help (0); + exit (0); + } + if (strlen (argv[i] + 1) == 8 && + strcmp (argv[i] + 1, "-version") == 0) { + puts (BANNER); + puts (kpathsea_version_string); + puts ("Copyright 2017 Radical Eye Software.\n\ +There is NO warranty. You may redistribute this software\n\ +under the terms of the GNU General Public License\n\ +and the Dvips copyright.\n\ +For more information about these matters, see the files\n\ +named COPYING and dvips.h.\n\ +Primary author of Dvips: T. Rokicki."); + exit (0); + } +#endif /* KPATHSEA */ switch (c) { case '-': queryoptions = 1; -- cgit v1.2.3