chiark / gitweb /
string-util: when ellipsizing to a length if (size_t) -1, become a NOP
authorLennart Poettering <lennart@poettering.net>
Fri, 10 Nov 2017 20:41:53 +0000 (21:41 +0100)
committerSven Eden <yamakuzure@gmx.net>
Fri, 10 Nov 2017 20:41:53 +0000 (21:41 +0100)
commitb6015ad21060c42dcd2d0616033b0f2957facb99
tree841603ff3c5fbf883ec16e24b60b6162b873840d
parent858ba8e89f95cfbe734c5eca69e5c77e4291d786
string-util: when ellipsizing to a length if (size_t) -1, become a NOP

Let's say that (size_t) -1 (i.e. SIZE_T_MAX) is equivalent to
"unbounded" ellipsation, i.e. ellipsation as NOP. In which case the
relevant functions become little more than strdup()/strndup().

This is useful to simplify caller code in case we want to turn off
ellipsation in certain code paths with minimal caller-side handling for
this.
src/basic/string-util.c