]> git.lyx.org Git - lyx.git/blobdiff - src/lyx_main.C
src/support/unlink.C: Fix an #include error
[lyx.git] / src / lyx_main.C
index 2f50c17ad652a57ae40a115c27bda8e00c22af61..add424f8b0f2f7f353b269b0a99fb78dcd4553ba 100644 (file)
@@ -110,9 +110,6 @@ bool use_gui = true;
 
 namespace {
 
-/// Don't try to remove the temporary directory if it has not been created
-bool remove_tmpdir = false;
-
 // Filled with the command line arguments "foo" of "-sysdir foo" or
 // "-userdir foo".
 string cl_system_support;
@@ -422,7 +419,7 @@ void LyX::prepareExit()
        pimpl_->buffer_list_.closeAll();
 
        // do any other cleanup procedures now
-       if (remove_tmpdir) {
+       if (package().temp_dir() != package().system_temp_dir()) {
                lyxerr[Debug::INFO] << "Deleting tmp dir "
                                    << package().temp_dir() << endl;
 
@@ -483,7 +480,8 @@ int LyX::init(int & argc, char * argv[])
                // get absolute path of file and add ".lyx" to
                // the filename if necessary
                pimpl_->files_to_load_.push_back(fileSearch(string(),
-                       os::internal_path(to_utf8(from_local8bit(argv[argi]))), "lyx"));
+                       os::internal_path(to_utf8(from_local8bit(argv[argi]))),
+                       "lyx", support::allow_unreadable));
        }
 
        if (first_start)
@@ -856,7 +854,6 @@ bool LyX::init()
                // trying again but simply exit.
                return false;
        }
-       remove_tmpdir = true;
 
        if (lyxerr.debugging(Debug::INIT)) {
                lyxerr << "LyX tmp dir: `" << package().temp_dir() << '\'' << endl;