texlive[64266] Build/source/texk/dvipsk: dvips: check options --help

commits+takuji at tug.org commits+takuji at tug.org
Fri Sep 2 15:19:45 CEST 2022


Revision: 64266
          http://tug.org/svn/texlive?view=revision&revision=64266
Author:   takuji
Date:     2022-09-02 15:19:45 +0200 (Fri, 02 Sep 2022)
Log Message:
-----------
dvips: check options --help & --version before looking up texmf.cnf

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	2022-09-02 11:19:19 UTC (rev 64265)
+++ trunk/Build/source/texk/dvipsk/ChangeLog	2022-09-02 13:19:45 UTC (rev 64266)
@@ -1,3 +1,9 @@
+2022-09-02  TANAKA Takuji  <ttk at t-lab.opal.ne.jp>
+
+	* dvips.c:
+	Check options --help and --version before getdefaults(CONFIGFILE).
+	This change prevents unwanted looking for texmf.cnf.
+
 2022-04-06  TANAKA Takuji  <ttk at t-lab.opal.ne.jp>
 
 	* tfmload.c:

Modified: trunk/Build/source/texk/dvipsk/dvips.c
===================================================================
--- trunk/Build/source/texk/dvipsk/dvips.c	2022-09-02 11:19:19 UTC (rev 64265)
+++ trunk/Build/source/texk/dvipsk/dvips.c	2022-09-02 13:19:45 UTC (rev 64266)
@@ -693,6 +693,23 @@
          printf("%s %s\n", banner, banner2);
          exit(0);
       }
+      /* print information and exit if dvips finds options --help or --version */
+      if (strlen(argv[1]) == 6 && strcmp(argv[1], "--help") == 0) {
+         help (0);
+         exit (0);
+      }
+      if (strlen (argv[1]) == 9 && strcmp(argv[1], "--version") == 0) {
+         puts (BANNER);
+         puts (kpathsea_version_string);
+         puts ("Copyright 2022 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 */
 #endif /* VMS */
@@ -730,27 +747,6 @@
          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 2022 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.