Skip to content
Permalink
Browse files

Fixed the updater to use the argument escaping code from utilities.

This fixes #2891
  • Loading branch information...
kenkendk committed Nov 21, 2017
1 parent 514a90b commit b42ab42e57ac8683422fcfd8f0c96a548caa0a19
Showing with 4 additions and 4 deletions.
  1. +2 −4 Duplicati/Library/AutoUpdater/UpdaterManager.cs
  2. +2 −0 Duplicati/Library/Utility/Utility.cs
@@ -1070,9 +1070,8 @@ public static int RunFromMostRecentSpawn(System.Reflection.MethodInfo method, st
return r;
}

var args = Environment.CommandLine;
var app = Environment.GetCommandLineArgs().First();
args = args.Substring(app.Length);
var args = Library.Utility.Utility.WrapAsCommandLine(Environment.GetCommandLineArgs().Skip(1), false);

if (!Path.IsPathRooted(app))
app = Path.Combine(InstalledBaseDir, app);
@@ -1216,9 +1215,8 @@ public static int RunFromMostRecentAppDomain(System.Reflection.MethodInfo method

try
{
var args = Environment.CommandLine;
var app = Environment.GetCommandLineArgs().First();
args = args.Substring(app.Length);
var args = Library.Utility.Utility.WrapAsCommandLine(Environment.GetCommandLineArgs().Skip(1), false);

if (!System.IO.Path.IsPathRooted(app))
app = System.IO.Path.Combine(InstalledBaseDir, app);
@@ -1540,6 +1540,8 @@ public static string WrapCommandLineElement(string arg, bool allowEnvExpansion)
// Windows needs only needs " replaced with "",
// but is prone to %var% expansion when used in
// immediate mode (i.e. from command prompt)
// Fortunately it does not expand when processes
// are started from within .Net

// TODO: I have not found a way to avoid escaping %varname%,
// and sadly it expands only if the variable exists

1 comment on commit b42ab42

@duplicatibot

This comment has been minimized.

Copy link

commented on b42ab42 Sep 6, 2019

This commit has been mentioned on Duplicati. There might be relevant details there:

https://forum.duplicati.com/t/bug-regular-expression-filter-operator-or-does-not-work-inside-parenthesis/7950/8

Please sign in to comment.
You can’t perform that action at this time.