mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-05 14:38:09 +02:00
shared: add nm_str_buf_append_required_delimiter()
This commit is contained in:
parent
85e27b1f9c
commit
5222f1b5ff
1 changed files with 13 additions and 0 deletions
|
|
@ -286,6 +286,19 @@ nm_str_buf_ensure_trailing_c (NMStrBuf *strbuf, char ch)
|
|||
nm_str_buf_append_c (strbuf, ch);
|
||||
}
|
||||
|
||||
static inline NMStrBuf *
|
||||
nm_str_buf_append_required_delimiter (NMStrBuf *strbuf,
|
||||
char delimiter)
|
||||
{
|
||||
_nm_str_buf_assert (strbuf);
|
||||
|
||||
/* appends the @delimiter if it is required (that is, if the
|
||||
* string is not empty). */
|
||||
if (strbuf->len > 0)
|
||||
nm_str_buf_append_c (strbuf, delimiter);
|
||||
return strbuf;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
static inline gboolean
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue