@b4n commented on this pull request.


> -                     utils_string_replace_all(haystack, "%f", replacement);
-                       g_free(replacement);
-               }
-
-               if (g_utf8_strchr(needles, -1, 'l') != NULL) {
-                       /* replace %l with the current 1-based line number */
-                       line_num = sci_get_current_line(doc->editor->sci) + 1;
-                       replacement = g_strdup_printf("%i", line_num);
-                       utils_string_replace_all(haystack, "%l", replacement);
-                       g_free(replacement);
+               p++;
+               if (! *p || *p == '%') /* %% or trailing % -> % */
+                       g_string_append_c(res, '%');
+               else if (! insert_replacement(res, *p, data))
+               {
+                       /* unknown placeholder, leave it literally */

regarding what to do with unknown placeholders, maybe we should at least log 
something here?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/4318#pullrequestreview-2907737854
You are receiving this because you are subscribed to this thread.

Message ID: <geany/geany/pull/4318/review/[email protected]>

Reply via email to