]> git.lyx.org Git - lyx.git/blobdiff - src/support/FileName.cpp
Fix samba related crashes
[lyx.git] / src / support / FileName.cpp
index f37b6dffd052fac09aef9c9d9176a736511391d4..470ff9091133ff9f0c9fcd4c68fb01e489794dab 100644 (file)
@@ -543,7 +543,9 @@ unsigned long FileName::checksum() const
                return result;
 
        struct stat info;
-       fstat(fd, &info);
+       if (fstat(fd, &info))
+               // bug 5891
+               return result;
 
        void * mm = mmap(0, info.st_size, PROT_READ,
                         MAP_PRIVATE, fd, 0);
@@ -1079,7 +1081,7 @@ string DocFileName::relFileName(string const & path) const
 }
 
 
-string DocFileName::outputFilename(string const & path) const
+string DocFileName::outputFileName(string const & path) const
 {
        return save_abs_path_ ? absFileName() : relFileName(path);
 }
@@ -1109,7 +1111,7 @@ string DocFileName::mangledFileName(string const & dir) const
        // in the name.
        static string const keep = "abcdefghijklmnopqrstuvwxyz"
                                   "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
-                                  "+,-0123456789;=";
+                                  "+-0123456789;=";
        string::size_type pos = 0;
        while ((pos = mname.find_first_not_of(keep, pos)) != string::npos)
                mname[pos++] = '_';
@@ -1157,9 +1159,9 @@ bool DocFileName::isZipped() const
 }
 
 
-string DocFileName::unzippedFilename() const
+string DocFileName::unzippedFileName() const
 {
-       return unzippedFileName(absFileName());
+       return support::unzippedFileName(absFileName());
 }