# HG changeset patch # User jwe # Date 780160748 0 # Node ID 54a6858bc7e7206f0ebcd95600bd9e49feb817d9 # Parent 43fc5a13be237247048cc833c2b766deb8650db5 [project @ 1994-09-21 15:17:38 by jwe] diff --git a/src/dynamic-ld.cc b/src/dynamic-ld.cc --- a/src/dynamic-ld.cc +++ b/src/dynamic-ld.cc @@ -42,6 +42,7 @@ #include "user-prefs.h" #include "variables.h" #include "defaults.h" +#include "dirfns.h" #include "octave.h" #include "utils.h" #include "error.h" @@ -103,7 +104,10 @@ if (! initialized) { - char *full_path = dld_find_executable (raw_prog_name); + static char *prog = make_absolute (raw_prog_name, + the_current_working_directory); + + char *full_path = dld_find_executable (prog); if (full_path) { @@ -115,7 +119,10 @@ initialized = 1; } else - error ("octave_dld_init: can't find full path to `%s'", prog_name); + { + error ("octave_dld_init: can't find full path to `%s'", + raw_prog_name); + } } } diff --git a/src/octave.cc b/src/octave.cc --- a/src/octave.cc +++ b/src/octave.cc @@ -66,6 +66,7 @@ #include "octave.h" #include "parse.h" #include "defaults.h" +#include "user-prefs.h" #include "procstream.h" #include "unwind-prot.h" #include "octave-hist.h" @@ -419,29 +420,33 @@ exit (0); } +static void +initialize_error_handlers () +{ + set_Complex_error_handler (octave_Complex_error_handler); + + set_liboctave_error_handler (error); +} + // You guessed it. int main (int argc, char **argv) { -// Allow for system dependent initialization. See sysdep.cc for more -// details. +// The order of these calls is important, and initialize globals must +// come before the options are processed because some command line +// options override defaults. + + init_user_prefs (); + + initialize_pager (); + sysdep_init (); -// This is not really the right place to do this... - set_Complex_error_handler (octave_Complex_error_handler); - -// Or this, probably... - set_liboctave_error_handler (error); + initialize_error_handlers (); -// Do this first, since some command line arguments may override the -// defaults. initialize_globals (argv[0]); -// Initialize dynamic linking. This might not do anything. Must -// happen after initializing raw_prog_name. - init_dynamic_linker (); - int optc; while ((optc = getopt_long (argc, argv, short_opts, long_opts, 0)) != EOF) { @@ -490,7 +495,8 @@ atexit (cleanup_tmp_files); #endif - initialize_pager (); +// These can come after command line args since none of them set any +// defaults that might be changed by command line options. install_signal_handlers (); @@ -504,6 +510,8 @@ initialize_readline (); + init_dynamic_linker (); + if (! inhibit_startup_message) cout << "Octave, version " << version_string << ". Copyright (C) 1992, 1993, 1994 John W. Eaton.\n"