]> git.lyx.org Git - lyx.git/commitdiff
Fix MacOS crash on startus
authorAbdelrazak Younes <younes@lyx.org>
Thu, 23 Nov 2006 15:18:09 +0000 (15:18 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Thu, 23 Nov 2006 15:18:09 +0000 (15:18 +0000)
* 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

index 02263f2d804bb88d66e7ed121b120cf990fd9a5e..66daee095abff5b2be83941b006f7836e0b0c475 100644 (file)
@@ -425,17 +425,6 @@ void LyX::quit()
 int LyX::execBatchCommands(int & argc, char * argv[],
        vector<string> & 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"));