Remove useless calls to basename().
authored <ed@FreeBSD.org>
Sun, 1 May 2016 08:22:11 +0000 (08:22 +0000)
committered <ed@FreeBSD.org>
Sun, 1 May 2016 08:22:11 +0000 (08:22 +0000)
commit29410b4082844f1db01761aa2c06a05ea49034fc
tree3099b026b5642c95eb4110f7a0cc0b1c07db9061
parent2c269d5a3e740c85443f6b546e9839dd127481c8
Remove useless calls to basename().

There are a couple of places in the source three where we call
basename() on constant strings. This is bad, because the prototype
standardized by POSIX allows the implementation to use its argument as a
storage buffer.

This change eliminates some of these unportable calls to basename() in
cases where it was only added for cosmetical reasons, namely to trim
argv[0]. There's nothing wrong with setting argv[0] to the full path.

Reviewed by: jilles
Differential Revision: https://reviews.freebsd.org/D6093
lib/libutil/pw_util.c
sbin/hastd/hooks.c
usr.bin/newgrp/newgrp.c