summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHironobu Yamashita <h.y.acetaminophen@gmail.com>2018-10-06 14:50:30 +0000
committerHironobu Yamashita <h.y.acetaminophen@gmail.com>2018-10-06 14:50:30 +0000
commit0fe0354308f3fccd8bfd9600c1f3b1869b1e1162 (patch)
tree3acf523e124e6ffcdebb00330cbd482302e4c7af
parent5d9b1998357314184998b54d09f84c0ed0f9b04c (diff)
dvispc.c: prioritize outfile, more
git-svn-id: svn://tug.org/texlive/trunk@48843 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/texk/dviout-util/dvispc.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/Build/source/texk/dviout-util/dvispc.c b/Build/source/texk/dviout-util/dvispc.c
index 673329bb856..d88387cacb8 100644
--- a/Build/source/texk/dviout-util/dvispc.c
+++ b/Build/source/texk/dviout-util/dvispc.c
@@ -670,7 +670,11 @@ skip: ;
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 @@ skip: ;
}
/* [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 @@ same: strcpy(outfile, infile);
#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 @@ same: strcpy(outfile, infile);
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))