]> granicus.if.org Git - handbrake/commitdiff
WinGui: Fix to the autoname function {source_path} option. It would sometimes use...
authorsr55 <sr55.hb@outlook.com>
Tue, 29 Nov 2011 20:24:41 +0000 (20:24 +0000)
committersr55 <sr55.hb@outlook.com>
Tue, 29 Nov 2011 20:24:41 +0000 (20:24 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4368 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/CS/Functions/Main.cs

index 7287478641c38c5a04799234a8f8c0d9a8291744..28909b4034adbdf33f210082370d7ed40160454b 100644 (file)
@@ -245,7 +245,11 @@ namespace Handbrake.Functions
                 if (UserSettingService.GetUserSetting<string>(UserSettingConstants.AutoNamePath).Trim().StartsWith("{source_path}") && !string.IsNullOrEmpty(mainWindow.sourcePath))\r
                 {\r
                     string savedPath = UserSettingService.GetUserSetting<string>(UserSettingConstants.AutoNamePath).Trim().Replace("{source_path}\\", string.Empty).Replace("{source_path}", string.Empty);\r
-                    string requestedPath = Path.Combine(Path.GetDirectoryName(mainWindow.sourcePath), savedPath);\r
+\r
+                    string directory = Directory.Exists(mainWindow.sourcePath)\r
+                                           ? mainWindow.sourcePath\r
+                                           : Path.GetDirectoryName(mainWindow.sourcePath);\r
+                    string requestedPath = Path.Combine(directory, savedPath);\r
 \r
                     autoNamePath = Path.Combine(requestedPath, destinationFilename);\r
                     if (autoNamePath == mainWindow.sourcePath)\r