diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2010-11-09 11:05:55 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2010-11-09 11:05:55 +0000 |
commit | 3e252e0b1f588dc096652a4f1af3e829d478129e (patch) | |
tree | 92344792ad6af28f5c0327df1584492e00720980 /Build | |
parent | 90ff9d2294af1d0e24bbe0847fac31e3979bf887 (diff) |
dvi2tty bug fix
git-svn-id: svn://tug.org/texlive/trunk@20384 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
7 files changed, 95 insertions, 41 deletions
diff --git a/Build/source/texk/dvi2tty/ChangeLog b/Build/source/texk/dvi2tty/ChangeLog index 4fd8af96cbe..505bb93e00b 100644 --- a/Build/source/texk/dvi2tty/ChangeLog +++ b/Build/source/texk/dvi2tty/ChangeLog @@ -1,3 +1,7 @@ +2010-11-09 Peter Breitenlohner <peb@mppmu.mpg.de> + + * dvi2tty.test: Test input filename without ".dvi". + 2010-11-06 Peter Breitenlohner <peb@mppmu.mpg.de> * dvi2tty.test: New shell script for 'make check' test. diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.3-PATCHES/ChangeLog b/Build/source/texk/dvi2tty/dvi2tty-5.3.3-PATCHES/ChangeLog index e83a12f7550..bfdf3aab7cd 100644 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.3-PATCHES/ChangeLog +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3-PATCHES/ChangeLog @@ -3,6 +3,12 @@ * patch-01-texk (removed): Avoid unnecessary modifications. * patch-07-typo: Adapted. + * patch-61-bug-fix (new): Correctly handle input filenames + without ".dvi". + + * patch-62-kpathsea (new): Use kpse_readable_file() function + from kpathsea library, replacing duplicated ancient code. + 2010-11-06 Peter Breitenlohner <peb@mppmu.mpg.de> Import dvi2tty-5.3.3. diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.3-PATCHES/patch-61-bug-fix b/Build/source/texk/dvi2tty/dvi2tty-5.3.3-PATCHES/patch-61-bug-fix new file mode 100644 index 00000000000..7d7cb6e9c62 --- /dev/null +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3-PATCHES/patch-61-bug-fix @@ -0,0 +1,13 @@ +diff -ur dvi2tty-5.3.3.orig/dvi2tty.c dvi2tty-5.3.3/dvi2tty.c +--- dvi2tty-5.3.3.orig/dvi2tty.c 2010-11-06 20:09:00.000000000 +0100 ++++ dvi2tty-5.3.3/dvi2tty.c 2010-11-09 11:47:09.561737069 +0100 +@@ -588,8 +588,8 @@ + if (!readable_file(DVIfilename)) + #else + if ((i < 5) || strcmp(str+i-4, ".dvi")) +- strcat(DVIfilename, ".dvi"); + #endif ++ strcat(DVIfilename, ".dvi"); + + return; + diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.3-PATCHES/patch-62-kpathsea b/Build/source/texk/dvi2tty/dvi2tty-5.3.3-PATCHES/patch-62-kpathsea new file mode 100644 index 00000000000..341ba35c64f --- /dev/null +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3-PATCHES/patch-62-kpathsea @@ -0,0 +1,68 @@ +diff -ur dvi2tty-5.3.3.orig/dvi2tty.c dvi2tty-5.3.3/dvi2tty.c +--- dvi2tty-5.3.3.orig/dvi2tty.c 2010-11-09 11:47:09.000000000 +0100 ++++ dvi2tty-5.3.3/dvi2tty.c 2010-11-09 11:58:09.742662164 +0100 +@@ -533,44 +533,6 @@ + + + +-#ifdef KPATHSEA +-# ifdef __DJGPP__ +- /* `stat' is way too expensive for such a simple job. */ +-# define READABLE(fn, st) \ +- (access (fn, R_OK) == 0 && access (fn, D_OK) == -1) +-#else +-# define READABLE(fn, st) \ +- (access (fn, R_OK) == 0 && stat (fn, &(st)) == 0 && !S_ISDIR (st.st_mode)) +-#endif +- +-static char * +-readable_file(char *name) +-{ +- char *ret; +- +-#ifdef WIN32 +- unsigned int fa; +- +- fa = GetFileAttributes(name); +- if (fa == 0xFFFFFFFF) +- ret = NULL; +- else if ((fa & FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY) +- ret = NULL; +- else +- ret = name; +-#else /* ! WIN32 */ +- struct stat st; +- +- if (READABLE (name, st)) +- ret = name; +- else /* Some other error. */ +- ret = NULL; +-#endif +- return ret; +-} +-#endif +- +- + + /* + * GETFNAME -- {Make sure we have a .dvi filename. +@@ -585,7 +547,7 @@ + usage(ign); + strcpy(DVIfilename, str); + #ifdef KPATHSEA +- if (!readable_file(DVIfilename)) ++ if (!kpse_readable_file(DVIfilename)) + #else + if ((i < 5) || strcmp(str+i-4, ".dvi")) + #endif +diff -ur dvi2tty-5.3.3.orig/dvi2tty.h dvi2tty-5.3.3/dvi2tty.h +--- dvi2tty-5.3.3.orig/dvi2tty.h 2010-10-30 14:38:49.000000000 +0200 ++++ dvi2tty-5.3.3/dvi2tty.h 2010-11-09 11:58:14.187495166 +0100 +@@ -35,6 +35,7 @@ + #if defined(KPATHSEA) + # define NO_DEBUG 1 + # include <kpathsea/config.h> ++# include <kpathsea/readable.h> + # include <sys/types.h> + # include <sys/stat.h> + #else diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.3/dvi2tty.c b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/dvi2tty.c index 55196246275..5f40aaea787 100644 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.3/dvi2tty.c +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/dvi2tty.c @@ -533,44 +533,6 @@ void plcnxt(int pagnr) -#ifdef KPATHSEA -# ifdef __DJGPP__ - /* `stat' is way too expensive for such a simple job. */ -# define READABLE(fn, st) \ - (access (fn, R_OK) == 0 && access (fn, D_OK) == -1) -#else -# define READABLE(fn, st) \ - (access (fn, R_OK) == 0 && stat (fn, &(st)) == 0 && !S_ISDIR (st.st_mode)) -#endif - -static char * -readable_file(char *name) -{ - char *ret; - -#ifdef WIN32 - unsigned int fa; - - fa = GetFileAttributes(name); - if (fa == 0xFFFFFFFF) - ret = NULL; - else if ((fa & FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY) - ret = NULL; - else - ret = name; -#else /* ! WIN32 */ - struct stat st; - - if (READABLE (name, st)) - ret = name; - else /* Some other error. */ - ret = NULL; -#endif - return ret; -} -#endif - - /* * GETFNAME -- {Make sure we have a .dvi filename. @@ -585,11 +547,11 @@ void getfname(const char *str) usage(ign); strcpy(DVIfilename, str); #ifdef KPATHSEA - if (!readable_file(DVIfilename)) + if (!kpse_readable_file(DVIfilename)) #else if ((i < 5) || strcmp(str+i-4, ".dvi")) - strcat(DVIfilename, ".dvi"); #endif + strcat(DVIfilename, ".dvi"); return; diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.3/dvi2tty.h b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/dvi2tty.h index b3ad8146c32..e18d4a2a167 100644 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.3/dvi2tty.h +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/dvi2tty.h @@ -35,6 +35,7 @@ Copyright (C) 1989-2010 M.J.E. Mol, MESA Consulting B.V." #if defined(KPATHSEA) # define NO_DEBUG 1 # include <kpathsea/config.h> +# include <kpathsea/readable.h> # include <sys/types.h> # include <sys/stat.h> #else diff --git a/Build/source/texk/dvi2tty/dvi2tty.test b/Build/source/texk/dvi2tty/dvi2tty.test index 7699be4fbcc..6d0a77d4019 100755 --- a/Build/source/texk/dvi2tty/dvi2tty.test +++ b/Build/source/texk/dvi2tty/dvi2tty.test @@ -8,5 +8,5 @@ test_src=$srcdir/$DVI2TTY_TREE/test ./dvi2tty -u $test_src/test.dvi >testu.out && diff $srcdir/testu.tty testu.out || exit 1 -./dvi2tty $test_src/ligtest.dvi >ligtest.out && diff $srcdir/ligtest.tty ligtest.out || exit 1 +./dvi2tty $test_src/ligtest >ligtest.out && diff $srcdir/ligtest.tty ligtest.out || exit 1 |