1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 02:58:02 -06:00

Linux: Fix printing error when checking freespace during volume creation

No parent directory specified in the path, we assume current directory
We first check if parent directory exists before checking its free space
using wxgetDiskSpace

Based on idea proposed by @bogdro in PR#1025
This commit is contained in:
Mounir IDRASSI
2023-05-22 01:05:17 +02:00
parent eb61010ce2
commit b872702309

View File

@@ -652,7 +652,12 @@ namespace VeraCrypt
{
uint64 AvailableDiskSpace = 0;
wxLongLong diskSpace = 0;
if (wxGetDiskSpace (wxFileName (wstring (options->Path)).GetPath(), nullptr, &diskSpace))
wxString parentDir = wxFileName (wstring (options->Path)).GetPath();
if (parentDir.IsEmpty())
{
parentDir = wxT(".");
}
if (wxDirExists(parentDir) && wxGetDiskSpace (parentDir, nullptr, &diskSpace))
{
AvailableDiskSpace = (uint64) diskSpace.GetValue ();
if (maxVolumeSize > AvailableDiskSpace)