texlive[48843] Build/source/texk/dviout-util/dvispc.c: dvispc.c:

commits+hironobu at tug.org commits+hironobu at tug.org
Sat Oct 6 16:50:31 CEST 2018


Revision: 48843
          http://tug.org/svn/texlive?view=revision&revision=48843
Author:   hironobu
Date:     2018-10-06 16:50:30 +0200 (Sat, 06 Oct 2018)
Log Message:
-----------
dvispc.c: prioritize outfile, more

Modified Paths:
--------------
    trunk/Build/source/texk/dviout-util/dvispc.c

Modified: trunk/Build/source/texk/dviout-util/dvispc.c
===================================================================
--- trunk/Build/source/texk/dviout-util/dvispc.c	2018-10-06 13:52:02 UTC (rev 48842)
+++ trunk/Build/source/texk/dviout-util/dvispc.c	2018-10-06 14:50:30 UTC (rev 48843)
@@ -670,7 +670,11 @@
                 else
                     fp_out = stdout;
             }else   /* if fp_out == NULL, free stdout; otherwise empty stdin */
-                /* [TODO] ??? */
+                /* [TODO] to be confirmed
+                      if non-empty stdin, the only argument = outfile
+                        (input is taken from stdin)
+                      if redirected stdout, the only argument = infile
+                        (output goes to stdout for EXE2DVI, overwrite for EXE2INDEP) */
                 strcpy((fp_out == NULL)?outfile:infile, argv[argc-1]);
             break;
 
@@ -731,7 +735,7 @@
     }
 
     /* [TODO] comments not added yet */
-    if(i == argc - 1){
+    if(argc - i == 1){
         if((f_mode & EXE2INDEP) && !fnum){
 #ifdef UNIX
             static char tmpfile[] = "/tmp/dvispcXXXXXX";
@@ -754,7 +758,7 @@
 #endif
             f_overwrite = 1;
         }
-    }else if(i == argc - 2){
+    }else if(argc - i == 2){
 #ifdef UNIX
         struct stat infstat, outfstat;
 #endif
@@ -774,7 +778,8 @@
         fprintf(stderr, "Cannot open %s\n", infile);
         exit(1);
     }
-    if(fp_out == NULL){
+    /* [TODO] I'd like to use outfile if given */
+    if(fp_out == NULL || outfile){
         if(!*outfile)
             fp_out = (f_mode == EXE2TEXT || f_mode == EXE2SPECIAL)?stdout:stderr;
         else if((f_mode & EXE2INDEP))



More information about the tex-live-commits mailing list