Mercurial > octave-nkf
comparison src/defaults.cc @ 3195:7a5a5da64756
[project @ 1998-10-28 22:54:04 by jwe]
author | jwe |
---|---|
date | Wed, 28 Oct 1998 23:01:17 +0000 |
parents | bdf2186d4592 |
children | 041ea33fbbf4 |
comparison
equal
deleted
inserted
replaced
3194:bea685644090 | 3195:7a5a5da64756 |
---|---|
66 // (--exec-path path) | 66 // (--exec-path path) |
67 string Vexec_path; | 67 string Vexec_path; |
68 | 68 |
69 // Load path specified on command line. | 69 // Load path specified on command line. |
70 // (--path path; -p path) | 70 // (--path path; -p path) |
71 string Vload_path; | 71 static string Vload_path; |
72 | 72 |
73 // The default load path with OCTAVE_HOME appropriately substituted. | 73 // The default load path with OCTAVE_HOME appropriately substituted. |
74 static string Vdefault_load_path; | 74 static string Vdefault_load_path; |
75 | 75 |
76 // And the cached directory path corresponding to Vload_path. | 76 // And the cached directory path corresponding to Vload_path. |
174 } | 174 } |
175 else | 175 else |
176 Vexec_path = string (octave_exec_path); | 176 Vexec_path = string (octave_exec_path); |
177 } | 177 } |
178 | 178 |
179 // Handle OCTAVE_PATH from the environment like TeX handles TEXINPUTS. | |
180 // If the path starts with `:', prepend the standard path. If it ends | |
181 // with `:' append the standard path. If it begins and ends with | |
182 // `:', do both (which is useless, but the luser asked for it...). | |
183 | |
184 static void | 179 static void |
185 set_default_path (void) | 180 set_default_path (void) |
186 { | 181 { |
187 Vdefault_load_path = subst_octave_home (OCTAVE_FCNFILEPATH); | 182 Vdefault_load_path = subst_octave_home (OCTAVE_FCNFILEPATH); |
188 | 183 |
189 string oct_path = octave_env::getenv ("OCTAVE_PATH"); | 184 string oct_path = octave_env::getenv ("OCTAVE_PATH"); |
190 | 185 |
191 Vload_path = oct_path.empty () | 186 Vload_path = oct_path.empty () ? string (":") : oct_path; |
192 ? Vdefault_load_path : maybe_add_default_path (oct_path); | 187 |
193 | 188 Vload_path_dir_path = dir_path (Vload_path, Vdefault_load_path); |
194 Vload_path_dir_path = dir_path (Vload_path); | |
195 } | 189 } |
196 | 190 |
197 static void | 191 static void |
198 set_default_info_file (void) | 192 set_default_info_file (void) |
199 { | 193 { |
408 gripe_invalid_value_specified ("LOADPATH"); | 402 gripe_invalid_value_specified ("LOADPATH"); |
409 status = -1; | 403 status = -1; |
410 } | 404 } |
411 else | 405 else |
412 { | 406 { |
413 Vload_path = maybe_add_default_load_path (s); | 407 Vload_path = s; |
414 | 408 |
415 Vload_path_dir_path = dir_path (Vload_path); | 409 Vload_path_dir_path = dir_path (Vload_path, Vdefault_load_path); |
416 } | 410 } |
417 | 411 |
418 return status; | 412 return status; |
419 } | 413 } |
420 | 414 |
425 "name of the editor to be invoked by the edit_history command"); | 419 "name of the editor to be invoked by the edit_history command"); |
426 | 420 |
427 DEFVAR (EXEC_PATH, Vexec_path, 0, exec_path, | 421 DEFVAR (EXEC_PATH, Vexec_path, 0, exec_path, |
428 "colon separated list of directories to search for programs to run"); | 422 "colon separated list of directories to search for programs to run"); |
429 | 423 |
430 DEFVAR (LOADPATH, ":", 0, octave_loadpath, | 424 DEFVAR (LOADPATH, ":", 0, loadpath, |
431 "colon separated list of directories to search for scripts.\n\ | 425 "colon separated list of directories to search for scripts.\n\ |
432 The default value is \":\", which means to search the default list\n\ | 426 The default value is \":\", which means to search the default list\n\ |
433 of directories. The default list of directories may be found in\n\ | 427 of directories. The default list of directories may be found in\n\ |
434 the built-in constant DEFAULT_LOADPATH"); | 428 the built-in constant DEFAULT_LOADPATH"); |
435 | 429 |