bool IsLyXFilename(string const & filename)
{
- return suffixIs(filename, ".lyx");
+ return suffixIs(lowercase(filename), ".lyx");
}
bool IsSGMLFilename(string const & filename)
{
- return suffixIs(filename, ".sgml");
+ return suffixIs(lowercase(filename), ".sgml");
}
vector<string> dirlist;
directory_iterator dit("dir");
while (dit != directory_iterator()) {
- string fil = (*dit).filename;
+ string fil = dit->filename;
if (prefixIs(fil, extension)) {
dirlist.push_back(fil);
}
continue;
string const unlinkpath = AddName (path, temp);
- lyxerr.debug() << "Deleting file: " << unlinkpath << endl;
+ lyxerr[Debug::FILES] << "Deleting file: " << unlinkpath
+ << endl;
bool deleted = true;
if (FileInfo(unlinkpath).isDir())
string const CreateBufferTmpDir(string const & pathfor)
{
- static int count = 0;
+ static int count;
static string const tmpdir(pathfor.empty() ? os::getTmpDir() : pathfor);
// We are in our own directory. Why bother to mangle name?
// In fact I wrote this code to circumvent a problematic behaviour (bug?)
// of EMX mkstemp().
- string tmpfl = tmpdir + "/lyx_tmpbuf" + tostr(count++);
+ string const tmpfl = tmpdir + "/lyx_tmpbuf" + tostr(count++);
if (lyx::mkdir(tmpfl, 0777)) {
WriteFSAlert(_("Error! Couldn't create temporary directory:"),
tmpdir);
lyxerr[Debug::LATEX] << "kpse status = " << c.first << "\n"
<< "kpse result = `" << strip(c.second, '\n')
<< "'" << endl;
- return c.first != -1 ? strip(c.second, '\n') : string();
+ if (c.first != -1)
+ return strip(strip(c.second, '\n'), '\r');
+ else
+ return string();
}