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

elextr notifications at xxxxx
Tue Sep 15 02:04:45 UTC 2020


@elextr 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';

+1 Just FTR https://developer.gnome.org/glib/stable/index.html

-- 
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_r488338010
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20200914/c076301b/attachment.htm>


More information about the Github-comments mailing list