From: Angus Leeming Date: Wed, 26 Feb 2003 15:42:18 +0000 (+0000) Subject: Prevent a crash if the user is not using a tmp directory. X-Git-Tag: 1.6.10~17415 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=9790d38b16dd523050ec90c1cd03100299323f69;p=lyx.git Prevent a crash if the user is not using a tmp directory. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6283 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/graphics/ChangeLog b/src/graphics/ChangeLog index a2713e705e..ad2d18b826 100644 --- a/src/graphics/ChangeLog +++ b/src/graphics/ChangeLog @@ -1,3 +1,8 @@ +2003-02-26 Angus Leeming + + * PreviewLoader.C (startLoading): Prevent a crash if the user is + not using a tmp directory. + 2003-02-26 Angus Leeming * PreviewedInset.[Ch]: strip out the caching of the BufferView and diff --git a/src/graphics/PreviewLoader.C b/src/graphics/PreviewLoader.C index f6e094227f..37aab6ca36 100644 --- a/src/graphics/PreviewLoader.C +++ b/src/graphics/PreviewLoader.C @@ -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.