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
This commit is contained in:
Angus Leeming 2005-01-17 11:50:16 +00:00
parent cb4b42cc6c
commit 3a74ee036e
2 changed files with 12 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2005-01-17 Angus Leeming <leeming@lyx.org>
* package.C.in (get_binary_path): convert relative paths stored
in the PATH environment variable to absolute ones.
2005-01-16 Angus Leeming <leeming@lyx.org>
* filetools.[Ch] (prependEnvPath): prepend a list of paths to

View File

@ -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;
<< "</package>\n" << std::endl;
}
@ -388,11 +391,10 @@ string const get_binary_path(string const & exe)
std::vector<string>::const_iterator it = path.begin();
std::vector<string>::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;
}