rc.xml: split out rstrip() to string-helpers.c

This commit is contained in:
Johan Malm 2021-02-16 21:03:38 +00:00
parent bc04f50d14
commit a97428020e
3 changed files with 21 additions and 13 deletions

View file

@ -25,3 +25,13 @@ string_strip(char *s)
}
return s;
}
void
string_truncate_at_pattern(char *buf, const char *pattern)
{
char *p = strstr(buf, pattern);
if (!p) {
return;
}
*p = '\0';
}