[Github-comments] [geany/geany] Remove deprecated symbol: tm_get_real_path (PR #3024)

Thomas Martitz notifications at xxxxx
Mon Nov 29 06:47:47 UTC 2021


@kugel- commented on this pull request.



> @@ -2414,6 +2419,48 @@ void utils_start_new_geany_instance(const gchar *doc_path)
 }
 
 
+
+static int get_path_max(const char *path)
+{
+#ifdef PATH_MAX
+	return PATH_MAX;
+#else
+	int path_max = pathconf(path, _PC_PATH_MAX);
+	if (path_max <= 0)
+		path_max = 4096;
+	return path_max;
+#endif

I think the `pathconf` code should be the default, and `PATH_MAX` should only be considered on Windows. On Unix, `PATH_MAX` is not necessarily a constant.

Looks like the code from `realpath(3)` man page and it discusses problems with that code.

Apparently we should be doing `realpath(name, NULL)` but I'm unsure if it's supported on our relevant platforms?

-- 
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/3024#pullrequestreview-817405166
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20211128/076f7f00/attachment.htm>


More information about the Github-comments mailing list