From: sr55 Date: Fri, 31 Dec 2010 17:08:18 +0000 (+0000) Subject: WinGui: X-Git-Tag: 0.9.5~13 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=de17702605859fec7e90edd468ee690bfca109ac;p=handbrake WinGui: - Quick fix for the folder source selection when selecting a drive letter. It appears escape chars were getting sent to the CLI when they shouldn't have been. I'll tidy this up later. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3721 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- diff --git a/win/C#/HandBrake.ApplicationServices/Services/Scan.cs b/win/C#/HandBrake.ApplicationServices/Services/Scan.cs index e2412cbd3..2a5188ab6 100644 --- a/win/C#/HandBrake.ApplicationServices/Services/Scan.cs +++ b/win/C#/HandBrake.ApplicationServices/Services/Scan.cs @@ -184,14 +184,22 @@ namespace HandBrake.ApplicationServices.Services if (title > 0) extraArguments += " --scan "; + // Quick fix for "F:\\" style paths. Just get rid of the \\ so the CLI doesn't fall over. + // Sould probably clean up the escaping of the strings later. + if (sourcePath.ToString().EndsWith("\\")) + { + sourcePath = sourcePath.ToString().Replace("\\", string.Empty); + } + + string source = "\"" + sourcePath + "\""; + string command = String.Format(@" -i {0} -t{1} {2} -v ", source, title, extraArguments); + this.hbProc = new Process { StartInfo = { FileName = handbrakeCLIPath, - Arguments = - String.Format(@" -i ""{0}"" -t{1} {2} -v ", sourcePath, title, - extraArguments), + Arguments = command, RedirectStandardOutput = true, RedirectStandardError = true, UseShellExecute = false, @@ -213,7 +221,10 @@ namespace HandBrake.ApplicationServices.Services if (this.readData.Buffer.Length < 100000000) { scanLog.WriteLine(Logging.CreateCliLogHeader(null)); + scanLog.WriteLine("Query: " + command); scanLog.Write(this.readData.Buffer); + + logBuffer.AppendLine("Query: " + command); logBuffer.AppendLine(this.readData.Buffer.ToString()); } else