- /* Find absolute ARGV0 name, using PATH. */
- File_path path;
- path.parse_path (getenv ("PATH"));
+ string argv0_abs;
+ if (argv0_filename.is_absolute ())
+ {
+ argv0_abs = argv0_filename.to_string ();
+ if (be_verbose_global)
+ warning (_f ("Relocation: is absolute: argv0=%s", argv0_ptr));
+ }
+ else if (argv0_filename.dir_.length ())
+ {
+ argv0_abs = get_working_directory ()
+ + "/" + string (argv0_filename.to_string ());
+ if (be_verbose_global)
+ warning (_f ("Relocation: from cwd: argv0=%s", argv0_ptr));
+ }
+ else
+ {
+ /* Find absolute ARGV0 name, using PATH. */
+ File_path path;
+ path.parse_path (getenv ("PATH"));