memmove moves a number of bytes, not pointers, so if you passed a number
of arguments that is larger than the pointer byte size, you could
end up crashing or skipping the install of a file and installing another
twice.
Also, argv was never decreased to match the moved arguments, so the -t
parameter was added in the NULL argv slot.
Also, since parsemode exits on failure, don't bother checking return
value in xinstall (this would never trigger anyway because mode_t can be
unsigned).
This is required in order for autoconf's AC_PROG_INSTALL to use the sbase
install. Otherwise it will fall back to the slow and sucky install-sh script
from automake.
Given the following commands:
touch 1.txt; install -D 1.txt d/2.txt
find d
The result without this fix:
d
d/2.txt
d/2.txt/1.txt
The result with this patch applied:
d
d/2.txt