texlive[43565] Build/source/texk/dvipsk: dvipsk: show information and

commits+kakuto at tug.org commits+kakuto at tug.org
Tue Mar 21 06:09:36 CET 2017


Revision: 43565
          http://tug.org/svn/texlive?view=revision&revision=43565
Author:   kakuto
Date:     2017-03-21 06:09:36 +0100 (Tue, 21 Mar 2017)
Log Message:
-----------
dvipsk: show information and exit if options --version or --help are found

Modified Paths:
--------------
    trunk/Build/source/texk/dvipsk/ChangeLog
    trunk/Build/source/texk/dvipsk/dvips.c

Modified: trunk/Build/source/texk/dvipsk/ChangeLog
===================================================================
--- trunk/Build/source/texk/dvipsk/ChangeLog	2017-03-21 03:36:55 UTC (rev 43564)
+++ trunk/Build/source/texk/dvipsk/ChangeLog	2017-03-21 05:09:36 UTC (rev 43565)
@@ -1,3 +1,9 @@
+2017-03-21  Akira Kakuto  <kakuto at 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 at tug.org>
 
 	* configure.ac,

Modified: trunk/Build/source/texk/dvipsk/dvips.c
===================================================================
--- trunk/Build/source/texk/dvipsk/dvips.c	2017-03-21 03:36:55 UTC (rev 43564)
+++ trunk/Build/source/texk/dvipsk/dvips.c	2017-03-21 05:09:36 UTC (rev 43565)
@@ -663,21 +663,6 @@
 #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 @@
          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 @@
          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;



More information about the tex-live-commits mailing list