// early as possible.
lyx::lyxerr.setStream(cerr);
- lyx::support::os::init(argc, argv);
+ lyx::support::os::init(argc, &argv);
lyx::LyX the_lyx_instance;
};
/// Do some work just once.
-void init(int argc, char * argv[]);
+void init(int argc, char ** argv[]);
/// Returns the i-th program argument in utf8 encoding.
std::string utf8_argv(int i);
} // namespace anon
-void init(int argc, char * argv[])
+void init(int argc, char ** argv[])
{
argc_ = argc;
- argv_ = argv;
+ argv_ = *argv;
// Set environment's default locale
setlocale(LC_ALL, "");
} // namespace anon
-void init(int argc, char * argv[])
+void init(int argc, char ** argv[])
{
argc_ = argc;
- argv_ = argv;
+ argv_ = *argv;
// Set environment's default locale
setlocale(LC_ALL, "");
} // namespace anon
-void init(int argc, char * argv[])
+void init(int argc, char ** argv[])
{
/* Note from Angus, 17 Jan 2005:
*
*/
+#if defined(_MSC_VER) && (_MSC_VER >= 1900)
+ // Removing an argument from argv leads to an assertion on Windows
+ // when compiling with MSVC 2015 in debug mode (see bug #10440).
+ // To avoid this we make a copy of the array of pointers.
+ char ** newargv = (char **) malloc((argc + 1) * sizeof(char *));
+ if (newargv) {
+ memcpy(newargv, *argv, (argc + 1) * sizeof(char *));
+ *argv = newargv;
+ } else {
+ lyxerr << "LyX warning: Cannot make a copy of "
+ "command line arguments!"
+ << endl;
+ }
+#endif
+
+
// Get the wide program arguments array
#if defined(_MSC_VER) && (_MSC_VER >= 1900)
argv_ = CommandLineToArgvW(GetCommandLineW(), &argc_);
int main(int argc, char * argv[])
{
- os::init(argc, argv);
+ os::init(argc, &argv);
lyxerr.setStream(cerr);
if (argc < 2 || argc > 3) {
cerr << "Usage: " << argv[0] << " <input layout file> [<output layout file>]\n";
lyx::lyxerr.setStream(cerr);
- os::init(argc, argv);
+ os::init(argc, &argv);
lyx::TeX2LyXApp app(argc, argv);
return app.exec();
* DOCUMENT INPUT/OUTPUT
+- Conversion of files using the command line (e.g. for batch processing) is
+ again possible on Windows (bug 10440).
+
- Fix nested language handling with polyglossia (bug 9633).
- Fix usage of multiple varieties of the same polyglossia language.