VeraCrypt
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2023-05-22 01:05:17 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2023-05-22 01:05:17 +0200
commitb872702309b20f2467d58652c3b00493ac4058bd (patch)
tree44e1adf837c0557431ab51bf7a88bf1fab415040
parenteb61010ce2f1e9ed16f136500c6e76d2839bfd08 (diff)
downloadVeraCrypt-b872702309b20f2467d58652c3b00493ac4058bd.tar.gz
VeraCrypt-b872702309b20f2467d58652c3b00493ac4058bd.zip
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
-rw-r--r--src/Main/TextUserInterface.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Main/TextUserInterface.cpp b/src/Main/TextUserInterface.cpp
index 21d13a6f..b147a3d4 100644
--- a/src/Main/TextUserInterface.cpp
+++ b/src/Main/TextUserInterface.cpp
@@ -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)