Commits

Qasim Khalil committed f63e4cc

Automatically replace environment variables in volume string.

Comments (0)

Files changed (1)

src/KeepassTrueCryptMount/PwEntryExtension.cs

                 {
                     volumeString = entry.Strings.GetSafe(EntryStrings.Volume).ReadString();
                 }
-                arguments.Append(" /v ");
+
+                volumeString = Environment.ExpandEnvironmentVariables(volumeString); //Support environment variables
+
                 if (volumeString.Equals(""))
                 {
                     MessageBox.Show(LanguageTexts.TCNoVolumeSpecifiedError, LanguageTexts.TCMountError, MessageBoxButtons.OK, MessageBoxIcon.Error);
                     return "";
                 }
+
+                arguments.Append(" /v ");
                 if (volumeString.Contains(" ") && !volumeString.StartsWith("\"") && !volumeString.EndsWith("\""))
                 {
                     arguments.AppendFormat("\"{0}\"", volumeString);