comparison liboctave/pathsearch.cc @ 3834:414e694c9e6a

[project @ 2001-05-17 13:45:41 by jwe]
author jwe
date Thu, 17 May 2001 13:45:42 +0000
parents f3278ec3ccb7
children b10790694d48
comparison
equal deleted inserted replaced
3833:f3278ec3ccb7 3834:414e694c9e6a
134 } 134 }
135 135
136 void 136 void
137 dir_path::set_program_name (const std::string& nm) 137 dir_path::set_program_name (const std::string& nm)
138 { 138 {
139 std::string selfautodir = octave_env::getenv ("SELFAUTODIR");
140 std::string selfautoloc = octave_env::getenv ("SELFAUTOLOC");
141 std::string selfautoparent = octave_env::getenv ("SELFAUTOPARENT");
142
139 ::octave_kpse_set_progname (nm.c_str ()); 143 ::octave_kpse_set_progname (nm.c_str ());
140 144
141 // Calling kpse_set_progname has the unfortunate side-effect of 145 // Calling kpse_set_progname has the unfortunate side-effect of
142 // exporting the following variables. We make them empty here so 146 // exporting the following variables. If they were empty when we
143 // that they will not interfere with TeX, if it is run as a 147 // started, we make them empty again so that they will not interfere
144 // subprocess of Octave. 148 // with TeX if it is run as a subprocess of Octave (if they were set
149 // before, we want to preserve their values).
145 // 150 //
146 // XXX FIXME XXX -- is there a reasonable way to actually remove 151 // XXX FIXME XXX -- is there a reasonable way to actually remove
147 // them from the environment? 152 // them from the environment?
148 153
149 octave_env::putenv ("SELFAUTOLOC", ""); 154 if (selfautodir.empty ())
150 octave_env::putenv ("SELFAUTODIR", ""); 155 octave_env::putenv ("SELFAUTODIR", "");
151 octave_env::putenv ("SELFAUTOPARENT", ""); 156
152 octave_env::putenv ("TEXMFDBS", ""); 157 if (selfautoloc.empty ())
158 octave_env::putenv ("SELFAUTOLOC", "");
159
160 if (selfautoparent.empty ())
161 octave_env::putenv ("SELFAUTOPARENT", "");
153 } 162 }
154 163
155 void 164 void
156 dir_path::init (void) 165 dir_path::init (void)
157 { 166 {