]> git.lyx.org Git - features.git/commitdiff
Prevent a crash if the user is not using a tmp directory.
authorAngus Leeming <leeming@lyx.org>
Wed, 26 Feb 2003 15:42:18 +0000 (15:42 +0000)
committerAngus Leeming <leeming@lyx.org>
Wed, 26 Feb 2003 15:42:18 +0000 (15:42 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6283 a592a061-630c-0410-9148-cb99ea01b6c8

src/graphics/ChangeLog
src/graphics/PreviewLoader.C

index a2713e705e920aaf72c656668b0de3244dc7d6b1..ad2d18b8268a8af17bca08c09d144bb555644a94 100644 (file)
@@ -1,3 +1,8 @@
+2003-02-26  Angus Leeming  <angus@localhost.localdomain>
+
+       * PreviewLoader.C (startLoading): Prevent a crash if the user is
+       not using a tmp directory.
+
 2003-02-26  Angus Leeming  <leeming@lyx.org>
 
        * PreviewedInset.[Ch]: strip out the caching of the BufferView and
index f6e094227f119855cdf5ed05b95c9ddceb97c67d..37aab6ca3693834787867fdcccff2ee06b35b672 100644 (file)
@@ -449,7 +449,11 @@ void PreviewLoader::Impl::startLoading()
        lyxerr[Debug::GRAPHICS] << "PreviewLoader::startLoading()" << endl;
 
        // As used by the LaTeX file and by the resulting image files
-       string const filename_base(unique_filename(buffer_.tmppath));
+       string directory = buffer_.tmppath;
+       if (directory.empty())
+               directory = buffer_.filePath();
+       
+       string const filename_base(unique_filename(directory));
 
        // Create an InProgress instance to place in the map of all
        // such processes if it starts correctly.