]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
sbuf(9): Add sbuf_nl_terminate() API
authorcem <cem@FreeBSD.org>
Wed, 7 Aug 2019 19:27:14 +0000 (19:27 +0000)
committercem <cem@FreeBSD.org>
Wed, 7 Aug 2019 19:27:14 +0000 (19:27 +0000)
commitefd8ed9206ab1dd8d8305080fde369c9a9fc45b4
tree1866888e51f1ea8c830a5b119569d4c78b30d16f
parent07683c3cc6a2b5b6a980c40d6d0fd1e3ca37da8d
sbuf(9): Add sbuf_nl_terminate() API

The API is used to gracefully terminate text line(s) with a single \n.  If
the formatted buffer was empty or already ended in \n, it is unmodified.
Otherwise, a newline character is appended to it.  The API, like other
sbuf-modifying routines, is only valid while the sbuf is not FINISHED.

Reviewed by: rlibby
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D21030
share/man/man9/sbuf.9
sys/kern/subr_sbuf.c
sys/sys/sbuf.h