diff options
-rw-r--r-- | indra/newview/llfloateruipreview.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp index 1e92ac0b8e..645f8ef054 100644 --- a/indra/newview/llfloateruipreview.cpp +++ b/indra/newview/llfloateruipreview.cpp @@ -1051,6 +1051,7 @@ void LLFloaterUIPreview::onClickEditFloater() if(!LLFile::stat(exe_path.c_str(), &s)) // If the executable exists { // build paths and arguments + std::string quote = std::string("\""); std::string args; std::string custom_args = mEditorArgsTextBox->getText(); int position_of_file = custom_args.find(std::string("%FILE%"), 0); // prepare to replace %FILE% with actual file path @@ -1058,7 +1059,7 @@ void LLFloaterUIPreview::onClickEditFloater() std::string second_part_of_args = ""; if(-1 == position_of_file) // default: Executable.exe File.xml { - args = std::string("\"") + path + std::string("\""); // execute the command Program.exe "File.xml" + args = quote + path + quote; // execute the command Program.exe "File.xml" } else // use advanced command-line arguments, e.g. "Program.exe -safe File.xml" -windowed for "-safe %FILE% -windowed" { @@ -1085,7 +1086,7 @@ void LLFloaterUIPreview::onClickEditFloater() memset(&pinfo, 0, sizeof(pinfo)); std::string exe_name = exe_path.substr(last_slash_position+1); - args = exe_name + std::string(" ") + args; // and prepend the executable name, so we get 'Program.exe "Arg1"' + args = quote + exe_name + quote + std::string(" ") + args; // and prepend the executable name, so we get 'Program.exe "Arg1"' char *args2 = new char[args.size() + 1]; // Windows requires that the second parameter to CreateProcessA be a writable (non-const) string... strcpy(args2, args.c_str()); |