Expand tilde meaning in front of a path name.

This allows to address data in the current lyx-system-directory.
The additional prefix is '~:s/'
The original prefix '~/' still addresses current users home directory.
This commit is contained in:
Kornel Benko 2018-08-05 09:54:44 +02:00
parent e730234e57
commit ed8dfa3fa0

View File

@ -110,9 +110,16 @@ struct FileName::Private
static
string const handleTildeName(string const & name)
{
return name == "~" ? Package::get_home_dir().absFileName() :
prefixIs(name, "~/") ? Package::get_home_dir().absFileName() + name.substr(1) :
name;
string resname;
if ( name == "~" )
resname = Package::get_home_dir().absFileName();
else if ( prefixIs(name, "~/"))
resname = Package::get_home_dir().absFileName() + name.substr(1);
else if ( prefixIs(name, "~:s/"))
resname = package().system_support().absFileName() + name.substr(3);
else
resname = name;
return resname;
}
/// The absolute file name in UTF-8 encoding.