From 3e40bf3dbf2f926717177103e101cc8090e69994 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Thu, 23 Nov 2006 15:18:09 +0000 Subject: [PATCH] Fix MacOS crash on startus * LyX::execBatchCommands(): allow any extra argument unknown to the core to be passed out to the frontend. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16014 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/lyx_main.C | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/lyx_main.C b/src/lyx_main.C index 02263f2d80..66daee095a 100644 --- a/src/lyx_main.C +++ b/src/lyx_main.C @@ -425,17 +425,6 @@ void LyX::quit() int LyX::execBatchCommands(int & argc, char * argv[], vector & files) { - // check for any spurious extra arguments - // other than documents - for (int argi = 1; argi < argc ; ++argi) { - if (argv[argi][0] == '-') { - lyxerr << to_utf8( - bformat(_("Wrong command line option `%1$s'. Exiting."), - from_utf8(argv[argi]))) << endl; - return EXIT_FAILURE; - } - } - // Initialization of LyX (reads lyxrc and more) lyxerr[Debug::INIT] << "Initializing LyX::init..." << endl; bool success = init(); @@ -443,8 +432,14 @@ int LyX::execBatchCommands(int & argc, char * argv[], if (!success) return EXIT_FAILURE; - for (int argi = argc - 1; argi >= 1; --argi) + for (int argi = argc - 1; argi >= 1; --argi) { + // check for any remaining extra arguments other than + // document file names. These will be passed out to the + // frontend. + if (argv[argi][0] == '-') + continue; files.push_back(os::internal_path(argv[argi])); + } if (first_start) files.push_back(i18nLibFileSearch("examples", "splash.lyx")); -- 2.39.2