[Github-comments] [geany/geany] SaveActions: Add configurable target directory for instantly saved files (#2769)

Enrico Tröger notifications at xxxxx
Sun Apr 4 21:24:26 UTC 2021


@eht16 commented on this pull request.



>  		if (ft == NULL || ft->id == GEANY_FILETYPES_NONE)
 			/* ft is NULL when a new file without template was opened, so use the
 			 * configured default file type */
 			ft = filetypes_lookup_by_name(instantsave_default_ft);
 
-		if (ft != NULL)
-			/* add the filetype's default extension to the new filename */
+		/* construct filename */
+		directory = !EMPTY(instantsave_target_dir) ? instantsave_target_dir : g_get_tmp_dir();
+		new_filename = g_build_filename(directory, "gis_XXXXXX", NULL);
+		if (ft != NULL && !EMPTY(ft->extension))
 			SETPTR(new_filename, g_strconcat(new_filename, ".", ft->extension, NULL));

Great, you are uncovering very old bugs :). Should be fixed.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/2769#discussion_r606855584
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20210404/fe8bd82f/attachment-0001.htm>


More information about the Github-comments mailing list