From 78a15c044892a982ba1115e534ad146d142d1ecf Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Thu, 9 Apr 2020 09:21:05 +0200 Subject: [PATCH] 2005-07-25 Angus Leeming * dt2dv.c: Enable to handle .dvi files containing strings longer than 1024 chars. * Makefile: enable the to work out of the box on both *nix and Windows machines under the MinSYS environment. * man2ps: build fixes See https://marc.info/?l=lyx-devel&m=115228143031699 --- 3rdparty/dtl/dt2dv.c | 11 +++++++---- 3rdparty/dtl/man2ps | 6 +++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/3rdparty/dtl/dt2dv.c b/3rdparty/dtl/dt2dv.c index 67d4a31aa5..bcec4a07a2 100644 --- a/3rdparty/dtl/dt2dv.c +++ b/3rdparty/dtl/dt2dv.c @@ -10,6 +10,8 @@ - Geoffrey Tobin G.Tobin@ee.latrobe.edu.au - fixes: Michal Tomczak-Jaegermann ntomczak@vm.ucs.ualberta.ca Nelson H. F. Beebe beebe@math.utah.edu + Angus Leeming leeming@lyx.org: Enable dt2dv to handle .dvi files + containing strings longer than 1024 chars. - Reference: "The DVI Driver Standard, Level 0", by The TUG DVI Driver Standards Committee. Appendix A, "Device-Independent File Format". @@ -2229,7 +2231,7 @@ xfer_len_string /* transfer (length and) quoted string from dtl to dvi file, */ /* return number of bytes written to dvi file. */ { - U4 k, k2; + U4 k, k2, lstr_maxsize; Lstring lstr; if (debug) @@ -2238,12 +2240,13 @@ xfer_len_string fprintf (stderr, "(xfer_len_string) : entering xfer_len_string.\n"); } - init_Lstring (&lstr, LSIZE); - /* k[n] : length of special string */ k = get_unsigned (dtl); + lstr_maxsize = (k > LSIZE) ? k : LSIZE; + init_Lstring (&lstr, lstr_maxsize); + if (debug) { PRINT_PROGNAME; @@ -2573,7 +2576,7 @@ fontdef #ifdef HEX_CHECKSUM /* c[4] : (hexadecimal) checksum : I (gt) would prefer this */ xfer_hex (4, dtl, dvi); -#else /NOT HEX_CHECKSUM */ +#else /*NOT HEX_CHECKSUM */ /* c[4] : checksum (octal, for comparison with tftopl's .pl file) */ xfer_oct (4, dtl, dvi); #endif diff --git a/3rdparty/dtl/man2ps b/3rdparty/dtl/man2ps index 47eeb6e390..97684294a2 100644 --- a/3rdparty/dtl/man2ps +++ b/3rdparty/dtl/man2ps @@ -25,16 +25,16 @@ case `basename $0` in esac # We can use either GNU groff or Sun Solaris troff + dpost -if [ -x /usr/local/bin/groff ] +if [ which groff > /dev/null ] then # GNU groff TROFF="groff $FORMAT" TROFF2PS="cat" -elif [ -x /usr/lib/lp/postscript/dpost ] ++elif [ which dpost > /dev/null ] then # Solaris 2.1 TROFF="troff $FORMAT" TROFF2PS="/usr/lib/lp/postscript/dpost" else - echo "Cannot find troff-to-PostScript filter" ++ echo "Cannot find troff-to-PostScript filter" >&2 exit 1 fi