@tivrfoa commented on this pull request.
> + /* get last path_delimiter so we know the path */
+ int i;
+ int last_path_delimiter;
+ for (i = 0; locale_filename[i] != '\0'; ++i) {
+ if (locale_filename[i] == path_delimiter) {
+ last_path_delimiter = i;
+ }
+ }
+
+ /* get substring containing only the filename path */
+ gchar *filename_path = g_malloc((last_path_delimiter +
2) * sizeof(char));
+ strncpy(filename_path, locale_filename,
last_path_delimiter + 1);
+ filename_path[last_path_delimiter + 1] = '\0';
Thank you very much @codebrainz !
The code now is much simpler! I tested on Ubuntu and it worked.
And probably `g_path_get_dirname` already takes care of operating system path
delimiter.
--
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#discussion_r488339421