elextr requested changes on this pull request.
The use-case makes sense now that its explained clearly.
> + * @return A pointer to the style struct.
+ */
+GEANY_API_SYMBOL
+const GeanyLexerStyle *highlighting_get_named_style(const gchar *named_style)
+{
+ GeanyLexerStyle *cs;
+ gchar *comma, *name = NULL;
+
+ g_return_val_if_fail(named_style, NULL);
+ name = utils_strdupa(named_style); /* named_style must not be
written to, may be a static string */
+
+ comma = strstr(name, ",");
+ if (comma)
+ {
+ *comma = '\0'; /* terminate name to make lookup work */
+ }
Whats this doing? If you pass a name why does it need to terminate at a comma?
Either this is functionality specific to the particular useage, in which case
it should be in the caller, or it should be documented behaviour with an
explanation of why.
--
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/2336#pullrequestreview-297130510