]> git.lyx.org Git - lyx.git/blobdiff - src/lyx_main.C
Fix crash when running lyx -dbg insets -e ...
[lyx.git] / src / lyx_main.C
index 859d1fe672aa693e28aad8a9a9a15513d7ce084c..367911132c2fc604564ba71358426577d5a3a972 100644 (file)
 #include "converter.h"
 #include "language.h"
 #include "support/os.h"
+// for NO_LATEX
+#if 1
+#include "lyxfont.h"
+#endif
 
 using std::endl;
 
@@ -165,7 +169,7 @@ LyX::LyX(int * argc, char * argv[])
 
                // otherwise, let the GUI handle the batch command
                lyxGUI->regBuf(last_loaded);
-               lyxGUI->getLyXView()->getLyXFunc()->Dispatch(batch_command);
+               lyxGUI->getLyXView()->getLyXFunc()->dispatch(batch_command);
 
                // fall through...
        }
@@ -311,12 +315,19 @@ void LyX::init(bool gui)
                       <<_("set the environment variable LYX_DIR_11x to the "
                           "LyX system directory ")
                       << _("containing the file `chkconfig.ltx'.") << endl;
-               if (!path_shown)
+               if (!path_shown) {
+                       FileInfo fi(LYX_DIR);
+                       if (!fi.exist()) {
+                               lyxerr << "Couldn't even find the default LYX_DIR." << endl
+                                       << "Giving up." << endl;
+                               exit(1);
+                       }
                        lyxerr << _("Using built-in default ") 
                               << LYX_DIR << _(" but expect problems.")
                               << endl;
-               else
+               } else {
                        lyxerr << _("Expect problems.") << endl;
+               }
                system_lyxdir = LYX_DIR;
                path_shown = true;
        }