summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Build/source/texk/dviljk/ChangeLog5
-rw-r--r--Build/source/texk/dviljk/dvi2xx.c32
-rw-r--r--Build/source/texk/dviljk/dvi2xx.h1
3 files changed, 35 insertions, 3 deletions
diff --git a/Build/source/texk/dviljk/ChangeLog b/Build/source/texk/dviljk/ChangeLog
index 3cddb6471db..218b9ff2a97 100644
--- a/Build/source/texk/dviljk/ChangeLog
+++ b/Build/source/texk/dviljk/ChangeLog
@@ -3,6 +3,11 @@
* dvi2xx.c (CopyHPFile): Open include file only once, rewind
instead of reopen.
+ (main): Enforce the kpathsea program name to be "dvilj", we don't
+ want different search paths for the dviljk variations.
+ (DoSpecial): Search for include files with kpathsea, both via
+ DVILJINPUTS and TEXINPUTS.
+
2007-07-02 Joachim Schrod <jschrod@acm.org>
* dvi2xx.c (DoSpecial): Security issue: usage of tmpnam() caused
diff --git a/Build/source/texk/dviljk/dvi2xx.c b/Build/source/texk/dviljk/dvi2xx.c
index 32e717d5ca0..35581c4a442 100644
--- a/Build/source/texk/dviljk/dvi2xx.c
+++ b/Build/source/texk/dviljk/dvi2xx.c
@@ -175,7 +175,14 @@ char *argv[];
setbuf(ERR_STREAM, NULL);
G_progname = argv[0];
#ifdef KPATHSEA
- kpse_set_progname(argv[0]);
+ kpse_set_program_name("dvilj", NULL);
+#ifdef HAVE_PROGRAM_INVOCATION_NAME
+ /* ARGH. kpse_set_program_name() does not set the program name if we're on
+ a system where the feature HAVE_PROGRAM_INVOCATION_NAME is defined. Then
+ we have to call kpse_reset_program_name() to enforce our wish for our
+ program name. Brain-damaged interface, if you ask me. [03 Jul 07 -js] */
+ kpse_reset_program_name("dvilj");
+#endif
kpse_set_program_enabled (kpse_pk_format, MAKE_TEX_PK_BY_DEFAULT, kpse_src_compile);
#endif
DecodeArgs(argc, argv);
@@ -3902,7 +3909,7 @@ int n;
{
char xs[STRSIZE], ys[STRSIZE];
char *include_file = NULL;
- enum { VerbFile, HPFile, PSFile } file_type;
+ enum { None, VerbFile, HPFile, PSFile } file_type;
float x,y;
long4 x_pos, y_pos;
KeyWord k;
@@ -4091,11 +4098,27 @@ int n;
}
if ( include_file ) {
+ char * include_path;
last_rx = last_ry = UNKNOWN;
#ifdef IBM3812
PMPflush;
#endif
+ /* Search the include file with kpathsea, but don't open it immediately.
+ If it's a psfile special, it will get passed to Ghostscript. An
+ include file is often placed at the same place as documents: We use
+ both a program specific search path and the tex search path. We can
+ not use kpse_find_tex() as it would call mktex, which we don't want
+ to do for included PCL files. */
+ if ( (include_path = kpse_find_file(include_file, kpse_program_binary_format, false)) == NULL &&
+ (include_path = kpse_find_file(include_file, kpse_tex_format, false)) == NULL ) {
+ Warning ("Could not locate %s, ignoring inclusion special", include_file);
+ file_type = None;
+ } else {
+ free (include_file);
+ include_file = include_path;
+ }
+
#ifdef LJ
if ( file_type == PSFile) {
/* int height = rwi * (urx - llx) / (ury - lly);*/
@@ -4222,6 +4245,8 @@ int n;
CopyHPFile( include_file );
else if ( file_type == VerbFile )
CopyFile( include_file );
+ else if ( file_type == None )
+ /* do nothing */ ;
else
Warning ("This can't happen: unknown file_type value %d", file_type);
@@ -5652,8 +5677,9 @@ Warning(va_alist)
}
-/*
+/* ------------------------------------------------------------
* Local Variables:
* c-file-style: "gnu"
+ * fill-column: 76
* End:
*/
diff --git a/Build/source/texk/dviljk/dvi2xx.h b/Build/source/texk/dviljk/dvi2xx.h
index 333c493bc7b..aa6564e19f3 100644
--- a/Build/source/texk/dviljk/dvi2xx.h
+++ b/Build/source/texk/dviljk/dvi2xx.h
@@ -15,6 +15,7 @@
#include <kpathsea/magstep.h>
#include <kpathsea/proginit.h>
#include <kpathsea/progname.h>
+#include <kpathsea/tex-file.h>
#include <kpathsea/tex-glyph.h>
#include <kpathsea/tex-hush.h>
#include <kpathsea/tex-make.h>