diff liboctave/pathsearch.cc @ 3833:f3278ec3ccb7

[project @ 2001-05-17 12:31:52 by jwe]
author jwe
date Thu, 17 May 2001 12:31:52 +0000
parents 5a2c5361dbf1
children 414e694c9e6a
line wrap: on
line diff
--- a/liboctave/pathsearch.cc	Tue May 15 17:14:15 2001 +0000
+++ b/liboctave/pathsearch.cc	Thu May 17 12:31:52 2001 +0000
@@ -29,6 +29,7 @@
 #include <string>
 
 #include "lo-utils.h"
+#include "oct-env.h"
 #include "oct-kpse.h"
 #include "pathsearch.h"
 #include "str-vec.h"
@@ -136,6 +137,19 @@
 dir_path::set_program_name (const std::string& nm)
 {
   ::octave_kpse_set_progname (nm.c_str ());
+
+  // Calling kpse_set_progname has the unfortunate side-effect of
+  // exporting the following variables.  We make them empty here so
+  // that they will not interfere with TeX, if it is run as a
+  // subprocess of Octave.
+  //
+  // XXX FIXME XXX -- is there a reasonable way to actually remove
+  // them from the environment?
+
+  octave_env::putenv ("SELFAUTOLOC", "");
+  octave_env::putenv ("SELFAUTODIR", "");
+  octave_env::putenv ("SELFAUTOPARENT", "");
+  octave_env::putenv ("TEXMFDBS", "");
 }
 
 void