b4n commented on this pull request.
- @return @transfer{full} A newly-allocated array of transformed paths strings, terminated by
+ @c NULL. Use @c g_strfreev() to free it. + * + * @since 1.31 (API 232) + */ +GEANY_API_SYMBOL +gchar **utils_strv_shorten_file_list(gchar **file_names, gssize num) +{ + gsize i; + gchar *prefix, *substring, *lcs; + gchar *start, *end; + gchar **names; + gsize prefix_len, lcs_len; + + /* We don't dereference file_names if num == 0. */ + g_return_val_if_fail(num != 0 && file_names == NULL, NULL);
This should be `num == 0 || file_names != NULL`, as it's basically an assertion, and should list conditions expected to pass.