]> granicus.if.org Git - procps-ng/commit
library: help ensure 'escape_str' isn't executed twice
authorJim Warner <james.warner@comcast.net>
Sat, 26 Dec 2020 06:00:00 +0000 (00:00 -0600)
committerCraig Small <csmall@dropbear.xyz>
Mon, 28 Dec 2020 21:42:28 +0000 (08:42 +1100)
commiteea5626bb144328eb60e9ea8a29bd5b1f100ecd9
tree06b3a6d833e6b8a56cb1a5ddcfe6822b65726b44
parentc76144ead1cb2e10267751f0434f617e03084a91
library: help ensure 'escape_str' isn't executed twice

Now that the ps program is using 'escape_str' for most
of the library's returned strings, this patch tries to
lessen the prospects of executing that function twice.

Our newlib branch has achieved such a goal through the
elimination of nearly all escape.c code. However, here
we avoid API change by trading some 'escape_str' calls
(with wide character overhead) for a slightly extended
'escaped_copy' call (which incurs no multibyte costs).

Note: until we migrate to the newlib version, there is
a remaining call to 'escape_str' which we can't avoid.
Such code involves the 'escape_command' function call.

[ As we prepare for this new (final?) release, there ]
[ were already internal library changes that require ]
[ a new 'revision'. This patch won't impact the API! ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
proc/escape.c
proc/readproc.c