Skip to content

Commit

Permalink
Adding wrapping quotes around file arguments for .NET driver services
Browse files Browse the repository at this point in the history
There are several properties of driver services that refer to files
or file paths. These arguments should be wrapped in double-quotes so
as to support file names containing spaces. Fixes issue #6912.
  • Loading branch information
jimevans committed Feb 6, 2019
1 parent 362d04b commit 64320c7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions dotnet/src/webdriver/Chrome/ChromeDriverService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <copyright file="ChromeDriverService.cs" company="WebDriver Committers">
// <copyright file="ChromeDriverService.cs" company="WebDriver Committers">
// Licensed to the Software Freedom Conservancy (SFC) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
Expand Down Expand Up @@ -131,7 +131,7 @@ protected override string CommandLineArguments

if (!string.IsNullOrEmpty(this.logPath))
{
argsBuilder.AppendFormat(CultureInfo.InvariantCulture, " --log-path={0}", this.logPath);
argsBuilder.AppendFormat(CultureInfo.InvariantCulture, " --log-path=\"{0}\"", this.logPath);
}

if (!string.IsNullOrEmpty(this.urlPathPrefix))
Expand Down
6 changes: 3 additions & 3 deletions dotnet/src/webdriver/IE/InternetExplorerDriverService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <copyright file="InternetExplorerDriverService.cs" company="WebDriver Committers">
// <copyright file="InternetExplorerDriverService.cs" company="WebDriver Committers">
// Licensed to the Software Freedom Conservancy (SFC) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
Expand Down Expand Up @@ -116,12 +116,12 @@ protected override string CommandLineArguments

if (!string.IsNullOrEmpty(this.logFile))
{
argsBuilder.Append(string.Format(CultureInfo.InvariantCulture, " -log-file={0}", this.logFile));
argsBuilder.Append(string.Format(CultureInfo.InvariantCulture, " -log-file=\"{0}\"", this.logFile));
}

if (!string.IsNullOrEmpty(this.libraryExtractionPath))
{
argsBuilder.Append(string.Format(CultureInfo.InvariantCulture, " -extract-path={0}", this.libraryExtractionPath));
argsBuilder.Append(string.Format(CultureInfo.InvariantCulture, " -extract-path=\"{0}\"", this.libraryExtractionPath));
}

if (this.loggingLevel != InternetExplorerDriverLogLevel.Fatal)
Expand Down
4 changes: 2 additions & 2 deletions dotnet/src/webdriver/Opera/OperaDriverService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <copyright file="OperaDriverService.cs" company="WebDriver Committers">
// <copyright file="OperaDriverService.cs" company="WebDriver Committers">
// Licensed to the Software Freedom Conservancy (SFC) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
Expand Down Expand Up @@ -118,7 +118,7 @@ protected override string CommandLineArguments

if (!string.IsNullOrEmpty(this.logPath))
{
argsBuilder.AppendFormat(CultureInfo.InvariantCulture, " --log-path={0}", this.logPath);
argsBuilder.AppendFormat(CultureInfo.InvariantCulture, " --log-path=\"{0}\"", this.logPath);
}

if (!string.IsNullOrEmpty(this.urlPathPrefix))
Expand Down

0 comments on commit 64320c7

Please sign in to comment.