Project

General

Profile

Bug #129 » 0001-Ticket-10440-argv-modification-leads-to-runtime-erro.patch

Kolan Sh, 10/26/2016 05:00 PM

View differences:

src/LyX.cpp
LYXERR(Debug::LOCALE, message.title_ + ", " + message.details_);
}
// Bug #10440: argv modification leads to runtime error with msvc 2015, so copy them
char ** argv_local = new char * [argc + 1];
memcpy (argv_local, argv, (argc + 1) * sizeof (char *));
// Here we need to parse the command line. At least
// we need to parse for "-dbg" and "-help"
easyParse(argc, argv);
easyParse(argc, argv_local);
try {
init_package(os::utf8_argv(0), cl_system_support, cl_user_support);
......
setLocale();
if (!use_gui) {
LyXConsoleApp app(this, argc, argv);
LyXConsoleApp app(this, argc, argv_local);
// Reestablish our defaults, as Qt overwrites them
// after creating app
......
}
// Let the frontend parse and remove all arguments that it knows
pimpl_->application_.reset(createApplication(argc, argv));
pimpl_->application_.reset(createApplication(argc, argv_local));
// Reestablish our defaults, as Qt overwrites them
// after createApplication()
......
// Parse and remove all known arguments in the LyX singleton
// Give an error for all remaining ones.
int exit_status = init(argc, argv);
int exit_status = init(argc, argv_local);
delete [] argv_local;
if (exit_status) {
// Kill the application object before exiting.
pimpl_->application_.reset();
(2-2/2)