commit 2244c72115b6c16c4ba4c4761c22f0283b15ed82
Author: Pavel Sanda <[email protected]>
Date:   Fri Aug 28 01:32:32 2026 +0200

    Attempt to fix reported crash on mac.
    
    Probable cause was that upgrade removed path to tempdir location
    which remained in prefs. Missing parent dirs will cause assert
    in isDirWritable.
    
    https://www.mail-archive.com/[email protected]/msg226704.html
    
    Assisted-by: Claude Opus 4.8
---
 src/support/filetools.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/support/filetools.cpp b/src/support/filetools.cpp
index a4986f1ba2..f92d5a1843 100644
--- a/src/support/filetools.cpp
+++ b/src/support/filetools.cpp
@@ -560,10 +560,15 @@ FileName const createLyXTmpDir(FileName const & deflt)
        if (deflt.empty() || deflt == package().system_temp_dir())
                return createTmpDir(package().system_temp_dir(), "lyx_tmpdir");
 
+       // TODO cross-platform divergence flagged - check needed on non existent
+       // parent dirs - on windows creates missing parents(to check), on linux 
+       // mkdir fails and we fallback to system temp below (checked)
        if (deflt.createDirectory(0777))
                return deflt;
 
-       if (deflt.isDirWritable()) {
+       // check dir first - dead link, plain file or missing parent dir will 
make
+       // isDirWritable assert (crash from user's POV)
+       if (deflt.isDirectory() && deflt.isDirWritable()) {
                // deflt could not be created because it
                // did exist already, so let's create our own
                // dir inside deflt.
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to