mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-11 11:08: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:
@@ -652,7 +652,12 @@ namespace VeraCrypt
|
|||||||
{
|
{
|
||||||
uint64 AvailableDiskSpace = 0;
|
uint64 AvailableDiskSpace = 0;
|
||||||
wxLongLong diskSpace = 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 ();
|
AvailableDiskSpace = (uint64) diskSpace.GetValue ();
|
||||||
if (maxVolumeSize > AvailableDiskSpace)
|
if (maxVolumeSize > AvailableDiskSpace)
|
||||||
|
|||||||
Reference in New Issue
Block a user