Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7599)

Unified Diff: chrome/installer/mini_installer/mini_installer.cc

Issue 2655473002: Handle spaces in the name of the mini_installer. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/mini_installer/mini_installer.cc
diff --git a/chrome/installer/mini_installer/mini_installer.cc b/chrome/installer/mini_installer/mini_installer.cc
index be29092fd8adaf66086f878babd33898b74a3655..c62323fc0924de67b29d15794be1b32e7c43c1ca 100644
--- a/chrome/installer/mini_installer/mini_installer.cc
+++ b/chrome/installer/mini_installer/mini_installer.cc
@@ -249,6 +249,7 @@ void AppendCommandLineFlags(const Configuration& configuration,
// - configuration.program() returns the first command line argument
// passed into the program (that the user probably typed in this case).
// "mini_installer.exe"
+ // "mini_installer (1).exe"
// "mini_installer"
// "out\Release\mini_installer"
// - |exe_name| is the executable file of the current process.
@@ -256,7 +257,7 @@ void AppendCommandLineFlags(const Configuration& configuration,
//
// Note that there are three possibilities to handle here.
// Receive a cmdline containing:
- // 1) executable name WITH extension
+ // 1) executable name WITH extension (possibly containing a space)
// 2) executable name with NO extension
// 3) NO executable name as part of cmdline
const wchar_t* cmd_to_append = L"";
@@ -275,7 +276,7 @@ void AppendCommandLineFlags(const Configuration& configuration,
// extension. Then move to the space following the token.)
const wchar_t* tmp = SearchStringI(configuration.command_line(),
arg0_base_name);
- tmp = SearchStringI(tmp, L" ");
+ tmp = SearchStringI(tmp + ::lstrlen(arg0_base_name), L" ");
bcwhite 2017/01/26 15:36:22 If you know the length of the program name, why do
grt (UTC plus 2) 2017/01/26 16:07:47 I think it's possible that there could be a traili
cmd_to_append = tmp;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698