summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2017-03-21 05:09:36 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2017-03-21 05:09:36 +0000
commit2c396c31d4fa5268218d1e1607837b156cd1dc1f (patch)
tree2089625468cf2f37cf0b6faee5c9fa2a60cdd97d /Build
parent4e89bb784ad0311306cb4558368c5cda3d1af2cf (diff)
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
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/dvipsk/ChangeLog6
-rw-r--r--Build/source/texk/dvipsk/dvips.c40
2 files changed, 29 insertions, 17 deletions
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 <kakuto@fuk.kindai.ac.jp>
+
+ * 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 <karl@tug.org>
* 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;