mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 18:08:10 +00:00
findLyxBinary():
Add program suffix test before trying to determine and use the extension to search for the lyx-executable
This commit is contained in:
parent
ef94145dc2
commit
2f33755814
@ -348,7 +348,14 @@ bool lyxBinaryPath(FileName & lyx_binary, string const & search_dir, string cons
|
||||
FileName findLyxBinary(FileName const & abs_binary)
|
||||
{
|
||||
string ext;
|
||||
if (!abs_binary.extension().empty()) {
|
||||
string checkname = abs_binary.toFilesystemEncoding();
|
||||
int check_len = checkname.length();
|
||||
int prgsuffixlen = string(PROGRAM_SUFFIX).length();
|
||||
if ((prgsuffixlen > 0) && (check_len > prgsuffixlen) &&
|
||||
(checkname.substr(check_len-prgsuffixlen) == string(PROGRAM_SUFFIX))) {
|
||||
ext = "";
|
||||
}
|
||||
else if (!abs_binary.extension().empty()) {
|
||||
ext = "." + abs_binary.extension();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user