}
+bool isValidLaTeXFilename(string const & filename)
+{
+ string const invalid_chars("#$%{}()[]\"^");
+ if (filename.find_first_of(invalid_chars) != string::npos)
+ return false;
+ else
+ return true;
+}
+
+
string const latex_path(string const & original_path,
latex_path_extension extension,
latex_path_dots dots)
// Returns the real name of file name in directory path, with optional
// extension ext.
FileName const fileSearch(string const & path, string const & name,
- string const & ext, search_mode mode)
+ string const & ext, search_mode mode)
{
// if `name' is an absolute path, we ignore the setting of `path'
// Expand Environmentvariables in 'name'
token(l, '_', 0) + '_' + name,
ext);
if (!tmpold.empty()) {
- lyxerr << "i18nLibFileSearch: File `" << tmpold
+ lyxerr << "i18nLibFileSearch: File `" << tmpold
<< "' has been found by the old method" <<endl;
return tmpold;
}
(command.size() - start_script) : pos2 - start_script;
// Does this script file exist?
- string const script =
+ string const script =
libFileSearch(".", command.substr(start_script, size_script)).absFilename();
if (script.empty()) {
// If file is from LyXDir, display it as if it were relative.
string const system = package().system_support().absFilename();
if (prefixIs(str, system) && str != system)
- return from_utf8("[" + str.erase(0, system.length()) + "]");
+ return from_utf8("[" + str.erase(0, system.length()) + "]");
// replace /home/blah with ~/
string const home = package().home_dir().absFilename();
<< '\'' << endl;
if (c.first != -1)
return FileName(os::internal_path(rtrim(to_utf8(from_filesystem8bit(c.second)),
- "\n\r")));
+ "\n\r")));
else
return FileName();
}