From 3a74ee036ef76a576a44584f0a8cd93bcdbc4b5e Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Mon, 17 Jan 2005 11:50:16 +0000 Subject: [PATCH] Enable the lyx executable to be found from the PATH environment variable if it expands to elements with relative paths. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9487 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/support/ChangeLog | 5 +++++ src/support/package.C.in | 12 +++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/support/ChangeLog b/src/support/ChangeLog index e8c6702e5d..c6b679ebd8 100644 --- a/src/support/ChangeLog +++ b/src/support/ChangeLog @@ -1,3 +1,8 @@ +2005-01-17 Angus Leeming + + * package.C.in (get_binary_path): convert relative paths stored + in the PATH environment variable to absolute ones. + 2005-01-16 Angus Leeming * filetools.[Ch] (prependEnvPath): prepend a list of paths to diff --git a/src/support/package.C.in b/src/support/package.C.in index e468baeafb..039fb97541 100644 --- a/src/support/package.C.in +++ b/src/support/package.C.in @@ -80,6 +80,9 @@ void init_package(string const & command_line_arg0, Package const & package() { + // Commented out because package().locale_dir() can be called + // from the message translation code in messages.C before + // init_package() is called. Lars is on the case... // BOOST_ASSERT(initialised_); return package_; } @@ -150,7 +153,7 @@ Package::Package(string const & command_line_arg0, << "\tdocument_dir " << document_dir() << '\n' << "\ttemp_dir " << temp_dir() << '\n' << "\thome_dir " << home_dir() << '\n' - << "<\\package>\n" << std::endl; + << "\n" << std::endl; } @@ -388,11 +391,10 @@ string const get_binary_path(string const & exe) std::vector::const_iterator it = path.begin(); std::vector::const_iterator const end = path.end(); for (; it != end; ++it) { - if (!os::is_absolute_path(*it)) - // Someone is playing silly buggers. - continue; + // This will do nothing if *it is already absolute. + string const exe_dir = MakeAbsPath(*it); - string const exe_path = AddName(*it, exe_name); + string const exe_path = AddName(exe_dir, exe_name); if (FileInfo(exe_path, true).isOK()) return exe_path; } -- 2.39.5