[Github-comments] [geany/geany] Create project's filename path (#2586)

Matthew Brush notifications at xxxxx
Tue Sep 15 01:32:22 UTC 2020


@codebrainz commented on this pull request.



> @@ -772,6 +772,53 @@ static gboolean update_config(const PropertyDialogElements *e, gboolean new_proj
 		}
 		g_free(locale_path);
 	}
+
+	/* create filename path if it doesn't exist */
+	if ((err_code = utils_is_file_writable(locale_filename)) != 0) {
+
+		/* only create path if filename ends with '.geany' */
+		char *dot = strrchr(locale_filename, '.');
+		if (dot != NULL && strcmp(dot, ".geany") == 0) {
+
+			char path_delimiter = '/';
+
+#ifdef G_OS_WIN32
+            path_delimiter = '\\';
+#endif

GLib also has [some handy pre-processor macros](https://developer.gnome.org/glib/stable/glib-Standard-Macros.html#G-DIR-SEPARATOR:CAPS) which cover this scenario.

-- 
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/2586#pullrequestreview-488261634
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20200914/596e6544/attachment.htm>


More information about the Github-comments mailing list