[Github-comments] [geany/geany] Create project's filename path (#2586)
Matthew Brush
notifications at xxxxx
Tue Sep 15 01:27:25 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) {
FWIW, the GLib library that Geany uses has some [higher level string functions](https://developer.gnome.org/glib/stable/glib-String-Utility-Functions.html).
So like the above could be replaced with:
```c
if (g_str_has_suffix(locale_filename, ".geany"))
{
...
```
--
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-488260136
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20200914/5a8866a0/attachment.htm>
More information about the Github-comments
mailing list