diff options
-rw-r--r-- | Build/source/texk/dvidvi/ChangeLog | 8 | ||||
-rw-r--r-- | Build/source/texk/dvidvi/dvidvi.c | 12 | ||||
-rwxr-xr-x | Build/source/texk/dvidvi/dvidvi.test | 24 |
3 files changed, 34 insertions, 10 deletions
diff --git a/Build/source/texk/dvidvi/ChangeLog b/Build/source/texk/dvidvi/ChangeLog index 59f4f4ac786..2945e0bbe50 100644 --- a/Build/source/texk/dvidvi/ChangeLog +++ b/Build/source/texk/dvidvi/ChangeLog @@ -1,3 +1,11 @@ +2023-08-11 TANAKA Takuji <ttk@t-lab.opal.ne.jp> + + * dvidvi.c: + Skip Unicode conversion if command line arguments are missing + in order to prevent unwanted looking for texmf.cnf. (Windows only) + * dvidvi.test: + Make easier to test on Windows. + 2021-02-19 Karl Berry <karl@freefriends.org> * dvidvi.test, diff --git a/Build/source/texk/dvidvi/dvidvi.c b/Build/source/texk/dvidvi/dvidvi.c index 0e2b9b0f2a7..1749c566d15 100644 --- a/Build/source/texk/dvidvi/dvidvi.c +++ b/Build/source/texk/dvidvi/dvidvi.c @@ -1256,11 +1256,13 @@ int main(int argc, char *argv[]) #if defined(WIN32) && defined(KPATHSEA) int ac; char **av, *enc; - kpse_set_program_name(argv[0], "dvidvi"); - enc = kpse_var_value("command_line_encoding"); - if (get_command_line_args_utf8(enc, &ac, &av)) { - argc = ac; - argv = av; + if (argc>1) { + kpse_set_program_name(argv[0], "dvidvi"); + enc = kpse_var_value("command_line_encoding"); + if (get_command_line_args_utf8(enc, &ac, &av)) { + argc = ac; + argv = av; + } } #endif processargs(argc, argv) ; diff --git a/Build/source/texk/dvidvi/dvidvi.test b/Build/source/texk/dvidvi/dvidvi.test index 22aafae5753..14b89447758 100755 --- a/Build/source/texk/dvidvi/dvidvi.test +++ b/Build/source/texk/dvidvi/dvidvi.test @@ -4,20 +4,34 @@ # Copyright 2011 Peter Breitenlohner <tex-live@tug.org> # You may freely use, modify and/or distribute this file. +BinDir=${BinDir:-.} +ExeExt=${ExeExt:-} +_dvidvi=$BinDir/dvidvi$ExeExt + +# pre-generated test results in the repository are stored in LF +# but the output might be written in CRLF on some platform. +# if 'diff --strip-trailing-cr' is available, exploit it. +# (useful for tests on win32 binaries run on MSYS shell) +DIFF="diff" +$DIFF --strip-trailing-cr $0 $0 \ + && DIFF="diff --strip-trailing-cr" || echo + + rm -rf play* cp $srcdir/tests/play.dvi . -./dvidvi -f 5 -l @25 -m'4:-3,0(6,0)' play playout 2>playout.2 +$_dvidvi -f 5 -l @25 -m'4:-3,0(6,0)' play playout 2>playout.2 # # Eliminate version number for the comparison. grep -v '^This is dvidvi' playout.2 \ -| diff - $srcdir/tests/playout.2 \ +| $DIFF - $srcdir/tests/playout.2 \ || exit 1 rm -rf play* cp $srcdir/tests/playtate.dvi . -./dvidvi -f 5 -l @25 -m'4:-3,0(6,0)' playtate playout 2>playout.3 +$_dvidvi -f 5 -l @25 -m'4:-3,0(6,0)' playtate playout 2>playout.3 # grep -v '^This is dvidvi' playout.3 \ -| diff - $srcdir/tests/playout.3 \ -|| exit 1 +| $DIFF - $srcdir/tests/playout.3 \ +|| exit 2 +exit 0 |