From 4f4e29638ce972d0af2b06a9b4e5cd59dea113a4 Mon Sep 17 00:00:00 2001 From: Kenneth Skovhede Date: Fri, 8 Mar 2013 12:25:35 +0100 Subject: [PATCH] Fixed a problem where not supplying the tempdir option could cause a non-default value to be used. --- Duplicati/Library/Main/Interface.cs | 2 +- Duplicati/Library/Main/Options.cs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Duplicati/Library/Main/Interface.cs b/Duplicati/Library/Main/Interface.cs index 43566ebfe..d4a04740f 100644 --- a/Duplicati/Library/Main/Interface.cs +++ b/Duplicati/Library/Main/Interface.cs @@ -2075,7 +2075,7 @@ namespace Duplicati.Library.Main stats.VerboseRetryErrors = m_options.VerboseRetryErrors; } - if (!string.IsNullOrEmpty(m_options.TempDir)) + if (m_options.HasTempDir) Utility.TempFolder.SystemTempPath = m_options.TempDir; if (!string.IsNullOrEmpty(m_options.ThreadPriority)) diff --git a/Duplicati/Library/Main/Options.cs b/Duplicati/Library/Main/Options.cs index 003ab6880..92fda66c3 100644 --- a/Duplicati/Library/Main/Options.cs +++ b/Duplicati/Library/Main/Options.cs @@ -651,6 +651,11 @@ namespace Duplicati.Library.Main /// public bool Force { get { return GetBool("force"); } } + /// + /// Gets a value indicating whether a temporary folder has been specified + /// + public bool HasTempDir { get { return m_options.ContainsKey("tempdir") && !string.IsNullOrEmpty(m_options["tempdir"]); } } + /// /// Gets the folder where temporary files are stored ///