freebsd-src/usr.bin/xinstall
Dag-Erling Smørgrav 17dc7017d7 install: Simplify path construction.
There's no need to copy the path twice to split it into base and dir.
We simply call `basename()` first, then handle the two trivial cases in
which it isn't safe to call `dirname()`.

While here, add an early check that the destination is not an empty
string.  This would always fail eventually, so it may as well fail
right away.  Also add a test case for this shortcut.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D44743
2024-04-12 19:31:35 +02:00
..
tests install: Simplify path construction. 2024-04-12 19:31:35 +02:00
install.1 install: Always use a temporary file. 2024-04-12 19:31:35 +02:00
Makefile usr.bin: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
Makefile.depend Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
xinstall.c install: Simplify path construction. 2024-04-12 19:31:35 +02:00