comparison liboctave/pathsearch.cc @ 3196:3ac3e8edc258

[project @ 1998-10-28 23:04:39 by jwe]
author jwe
date Wed, 28 Oct 1998 23:11:11 +0000
parents 9580887dd160
children 48aa44151317
comparison
equal deleted inserted replaced
3195:7a5a5da64756 3196:3ac3e8edc258
37 { 37 {
38 // Have to redefine these because they conflict with new C++ keywords 38 // Have to redefine these because they conflict with new C++ keywords
39 // or otherwise cause trouble... 39 // or otherwise cause trouble...
40 #define string kpse_string 40 #define string kpse_string
41 41
42 #include <kpathsea/default.h>
43 #include <kpathsea/expand.h>
42 #include <kpathsea/pathsearch.h> 44 #include <kpathsea/pathsearch.h>
43 #include <kpathsea/progname.h> 45 #include <kpathsea/progname.h>
44 46
45 extern unsigned int kpathsea_debug; 47 extern unsigned int kpathsea_debug;
46 48
159 octave_kpathsea_initialized = true; 161 octave_kpathsea_initialized = true;
160 } 162 }
161 163
162 kpse_clear_dir_cache (); 164 kpse_clear_dir_cache ();
163 165
164 char *tmp = kpse_path_expand (p_orig.c_str ()); 166 char *t1 = 0;
165 if (tmp) 167
166 { 168 if (p_default.empty ())
167 p = tmp; 169 t1 = kpse_path_expand (p_orig.c_str ());
168 free (tmp); 170 else
171 {
172 char *t2 = kpse_expand_default (p_orig.c_str (), p_default.c_str ());
173
174 t1 = kpse_path_expand (t2);
175
176 if (t2)
177 free (t2);
178 }
179
180 if (t1)
181 {
182 p = t1;
183 free (t1);
169 } 184 }
170 else 185 else
171 p = string (); 186 p = string ();
172 187
173 int count = 0; 188 int count = 0;