[Github-comments] [geany/geany] Fix 1069 (#1445)
elextr
notifications at xxxxx
Thu Mar 23 23:11:22 UTC 2017
elextr approved this pull request.
@kugel- sorry I give up reviewing this, can't figure out the G* macro shit. Will approve so someone else can review it.
> + */
+static gchar *utils_strv_find_common_prefix(gchar **strv, size_t num)
+{
+ gchar *prefix, **ptr;
+
+ if (!NZV(strv))
+ return NULL;
+
+ if (num == 0)
+ num = g_strv_length(strv);
+
+ prefix = g_strdup(strv[0]);
+
+ for (gint i = 0; prefix[i]; i++)
+ {
+ foreach_strv(ptr, &strv[1])
why is this here?
> @@ -2031,6 +2031,199 @@ gchar **utils_strv_join(gchar **first, gchar **second)
return strv;
}
+/* * Returns the common prefix in a list of strings.
+ *
+ * The size of the list may be given explicitely automatically determined if passed a GStrv.
what you actually mean is a null terminated pointer array, GStrv is just a char**.
> + if (prefix[i] == '\0')
+ break;
+ }
+ return prefix;
+}
+
+/* * Returns the common prefix in a list of strings.
+ *
+ * The size of the list may be given explicitely automatically determined if passed a GStrv.
+ *
+ * @param strv The list of strings to process.
+ * @param num The number of strings contained in @a strv. Can be 0 if @a strv is a @c GStrv
+ *
+ * @return The common prefix that is part of all strings.
+ */
+gchar *utils_strv_find_lcs(gchar **strv, size_t num)
whats the difference between this and the previous function
--
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/1445#pullrequestreview-28793662
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20170323/282dacc3/attachment.html>
More information about the Github-comments
mailing list