@LiquidCake commented on this pull request.


> +     gchar *extension_postfix;
+       GeanyFiletype *filetype = get_doc_filetype_or_default(doc);
+
+       if (filetype != NULL && !EMPTY(filetype->extension))
+               extension_postfix = g_strconcat(".", filetype->extension, NULL);
+       else
+               extension_postfix = "";
+
+       for (i = 1; i < 1000; i++)
+       {
+               gchar *next_file_name, *next_file_path;
+
+               next_file_name = g_strdup_printf("%s%d%s", 
PERSISTENT_UNTITLED_DOC_FILE_NAME_PREFIX, i, extension_postfix);
+               next_file_path = g_strdup_printf("%s%c%s", 
persistent_untitled_docs_target_dir, G_DIR_SEPARATOR, next_file_name);
+
+               gboolean file_exists = g_file_test(next_file_path, 
G_FILE_TEST_EXISTS);

done

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3911#discussion_r1852765457
You are receiving this because you are subscribed to this thread.

Message ID: <geany/geany/pull/3911/review/[email protected]>

Reply via email to