From ee87b4fc30914eca576e70c3fd6afa0a0ac77972 Mon Sep 17 00:00:00 2001 From: Johan Malm Date: Thu, 25 Sep 2025 19:35:22 +0100 Subject: [PATCH] Remove unused function trim_last_field() --- include/common/string-helpers.h | 9 --------- src/common/string-helpers.c | 9 --------- 2 files changed, 18 deletions(-) diff --git a/include/common/string-helpers.h b/include/common/string-helpers.h index 0509d33c..35c994b2 100644 --- a/include/common/string-helpers.h +++ b/include/common/string-helpers.h @@ -15,15 +15,6 @@ bool string_null_or_empty(const char *s); */ bool str_space_only(const char *s); -/** - * trim_last_field() - Trim last field of string splitting on provided delim - * @buf: string to trim - * @delim: delimitator - * - * Example: With delim='_' and buf="foo_bar_baz" the return value is "foo_bar" - */ -void trim_last_field(char *buf, char delim); - /** * string_strip - strip white space left and right * Note: this function does a left skip, so the returning pointer cannot be diff --git a/src/common/string-helpers.c b/src/common/string-helpers.c index a0d73034..13fe6f68 100644 --- a/src/common/string-helpers.c +++ b/src/common/string-helpers.c @@ -20,15 +20,6 @@ string_null_or_empty(const char *s) return !s || !*s; } -void -trim_last_field(char *buf, char delim) -{ - char *p = strrchr(buf, delim); - if (p) { - *p = '\0'; - } -} - static void rtrim(char *s) {