[gimp] app: the crashlog file path is wrong on non-Win32.



commit 43d7a3c77dcb2b8132ba80da73c99271992ceff8
Author: Jehan <jehan girinstud io>
Date:   Thu Feb 8 23:05:26 2018 +0100

    app: the crashlog file path is wrong on non-Win32.
    
    Using g_get_user_data_dir() is maybe right on Win32 (for this roaming
    vs. local directory logics), but not on Unix-like systems, where we end
    up trying to write in the data directory (usually not even supposed to
    be writable by applications).
    Also while at it, I replace g_get_prgname() by PACKAGE_NAME. It turns
    out that this function returns NULL, maybe because of the init order.
    
    Actually ideally, this file should rather go under:
    $XDG_CACHE_HOME/GIMP/<version>/
    But last we discussed this, it was decided that files should not spread
    too much (though I still disagree!).

 app/signals.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/app/signals.c b/app/signals.c
index 08550ef..75da822 100644
--- a/app/signals.c
+++ b/app/signals.c
@@ -53,18 +53,23 @@ gimp_init_signal_handlers (gchar **backtrace_file)
   gchar  *filename;
   gchar  *dir;
 
+#ifdef G_OS_WIN32
   /* This has to be the non-roaming directory (i.e., the local
      directory) as backtraces correspond to the binaries on this
      system. */
   dir = g_build_filename (g_get_user_data_dir (),
                           GIMPDIR, GIMP_USER_VERSION, "CrashLog",
                           NULL);
+#else
+  dir = g_build_filename (gimp_directory (), "CrashLog", NULL);
+#endif
+
   /* Ensure the path exists. */
   g_mkdir_with_parents (dir, 0700);
 
   time (&t);
   filename = g_strdup_printf ("%s-crash-%" G_GUINT64_FORMAT ".txt",
-                              g_get_prgname (), t);
+                              PACKAGE_NAME, t);
   *backtrace_file = g_build_filename (dir, filename, NULL);
   g_free (filename);
   g_free (dir);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]