summaryrefslogtreecommitdiffstats
path: root/win/CS
diff options
context:
space:
mode:
authorsr55 <[email protected]>2011-11-29 20:24:41 +0000
committersr55 <[email protected]>2011-11-29 20:24:41 +0000
commit0755d229e3d67c896e441af22e93371fb56c466f (patch)
tree9ecd4be4ade5e8a7bcb623e33117603da8145698 /win/CS
parent201e0ba58839e9647dedf84452dfc9caa9d64910 (diff)
WinGui: Fix to the autoname function {source_path} option. It would sometimes use a directory 1 level up from where it was supposed to.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4368 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS')
-rw-r--r--win/CS/Functions/Main.cs6
1 files changed, 5 insertions, 1 deletions
diff --git a/win/CS/Functions/Main.cs b/win/CS/Functions/Main.cs
index 728747864..28909b403 100644
--- a/win/CS/Functions/Main.cs
+++ b/win/CS/Functions/Main.cs
@@ -245,7 +245,11 @@ namespace Handbrake.Functions
if (UserSettingService.GetUserSetting<string>(UserSettingConstants.AutoNamePath).Trim().StartsWith("{source_path}") && !string.IsNullOrEmpty(mainWindow.sourcePath))
{
string savedPath = UserSettingService.GetUserSetting<string>(UserSettingConstants.AutoNamePath).Trim().Replace("{source_path}\\", string.Empty).Replace("{source_path}", string.Empty);
- string requestedPath = Path.Combine(Path.GetDirectoryName(mainWindow.sourcePath), savedPath);
+
+ string directory = Directory.Exists(mainWindow.sourcePath)
+ ? mainWindow.sourcePath
+ : Path.GetDirectoryName(mainWindow.sourcePath);
+ string requestedPath = Path.Combine(directory, savedPath);
autoNamePath = Path.Combine(requestedPath, destinationFilename);
if (autoNamePath == mainWindow.sourcePath)