]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
sbuf(9): Add sbuf_nl_terminate() API
authorConrad Meyer <cem@FreeBSD.org>
Wed, 7 Aug 2019 19:27:14 +0000 (19:27 +0000)
committerConrad Meyer <cem@FreeBSD.org>
Wed, 7 Aug 2019 19:27:14 +0000 (19:27 +0000)
commit76cb1112da20279c59bc8189519c4122a4d0d96a
tree1866888e51f1ea8c830a5b119569d4c78b30d16f
parentd23813cdb9a927b0c2965fcb4979edaad5f21dae
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