Linux/MacOSX: cleaner code for handling of missing local HTML documentation.

This commit is contained in:
Mounir IDRASSI 2017-06-04 11:29:33 +02:00
parent d5b0e0db3f
commit 3e678f6868
No known key found for this signature in database
GPG Key ID: DD0C382D5FCFB8FC

View File

@ -1234,7 +1234,6 @@ namespace VeraCrypt
#elif defined (TC_UNIX) #elif defined (TC_UNIX)
htmlPath = L"/usr/share/veracrypt/doc/HTML/"; htmlPath = L"/usr/share/veracrypt/doc/HTML/";
#else #else
htmlPath = L"https://www.veracrypt.fr/en/";
localFile = false; localFile = false;
#endif #endif
if (localFile) if (localFile)
@ -1242,13 +1241,15 @@ namespace VeraCrypt
/* check if local file exists */ /* check if local file exists */
wxFileName htmlFile = htmlPath + url; wxFileName htmlFile = htmlPath + url;
htmlFile.Normalize(); htmlFile.Normalize();
if (!htmlFile.FileExists()) localFile = htmlFile.FileExists();
}
if (!localFile)
{ {
htmlPath = L"https://www.veracrypt.fr/en/"; htmlPath = L"https://www.veracrypt.fr/en/";
url.Replace (L" ", L"%20"); url.Replace (L" ", L"%20");
url.Replace (L"'", L"%27"); url.Replace (L"'", L"%27");
} }
}
url = htmlPath + url; url = htmlPath + url;
} }