]> glassweightruler.freedombox.rocks Git - Ventoy.git/blobdiff - LinuxGUI/Ventoy2Disk/ventoy_gui.c
Fix the issue (introduced in 1.1.06) that the Ventoy ISO partition cannot be mounted...
[Ventoy.git] / LinuxGUI / Ventoy2Disk / ventoy_gui.c
index 45bae96956940b58638870bb3fb76ed0b9edc1a7..a0512187f2959390a559f2a72ca67c1c42a594ea 100644 (file)
@@ -1315,17 +1315,37 @@ int main(int argc, char **argv)
             if (env)
             {
                 g_xdg_log = 1;
-                snprintf(g_log_file, sizeof(g_log_file), "%s/ventoy.log", env);
+                snprintf(g_log_file, sizeof(g_log_file), "%s/ventoy/ventoy.log", env);
                 touch_new_file(g_log_file);
             }
+            else
+            {
+                env = getenv("HOME");
+                if (env && is_dir_exist("%s/.cache", env))
+                {
+                    g_xdg_log = 1;
+                    snprintf(g_log_file, sizeof(g_log_file), "%s/.cache/ventoy/ventoy.log", env);
+                    touch_new_file(g_log_file);
+                }
+            }
             
             env = getenv("XDG_CONFIG_HOME");
             if (env)
             {
                 g_xdg_ini = 1;
-                snprintf(g_ini_file, sizeof(g_ini_file), "%s/Ventoy2Disk.ini", env);
+                snprintf(g_ini_file, sizeof(g_ini_file), "%s/ventoy/Ventoy2Disk.ini", env);
                 touch_new_file(g_ini_file);
             }
+            else
+            {
+                env = getenv("HOME");
+                if (env && is_dir_exist("%s/.config", env))
+                {
+                    g_xdg_ini = 1;
+                    snprintf(g_ini_file, sizeof(g_ini_file), "%s/.config/ventoy/Ventoy2Disk.ini", env);
+                    touch_new_file(g_ini_file);
+                }
+            }
         }
     }