mirror of
https://github.com/veracrypt/VeraCrypt
synced 2024-11-10 05:03:33 +01: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:
parent
eb61010ce2
commit
b872702309
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user