From 89721c3b4cd1ef8aac3b0f79346c16343d2f8c2d Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Tue, 28 Nov 2006 20:04:16 +0000 Subject: [PATCH] Do not delete /tmp. Somebody should find a real fix. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16094 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/lyx_main.C | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lyx_main.C b/src/lyx_main.C index 6833bc16c0..2a4955abf7 100644 --- a/src/lyx_main.C +++ b/src/lyx_main.C @@ -415,6 +415,14 @@ void LyX::prepareExit() // do any other cleanup procedures now lyxerr[Debug::INFO] << "Deleting tmp dir " << package().temp_dir() << endl; + // Prevent the deletion of /tmp if LyX was called with invalid + // arguments. Does not work on windows. + // FIXME: Fix the real bug instead. + if (package().temp_dir() == "/tmp") { + lyxerr << "Not deleting /tmp." << endl; + return; + } + if (!destroyDir(package().temp_dir())) { docstring const msg = bformat(_("Unable to remove the temporary directory %1$s"),