Trim out excessive / with -v when target directory ends with a trailing '/'.

This is a minor nit after r289391 made all installations to a directory always
end in a trailing '/'.

MFC after:	3 days
Sponsored by:	EMC / Isilon Storage Division
This commit is contained in:
bdrewery 2016-08-10 18:18:51 +00:00
parent 899f803567
commit e96f85f48f

View File

@ -749,8 +749,9 @@ install(const char *from_name, const char *to_name, u_long fset, u_int flags)
}
/* Build the target path. */
if (flags & DIRECTORY) {
(void)snprintf(pathbuf, sizeof(pathbuf), "%s/%s",
(void)snprintf(pathbuf, sizeof(pathbuf), "%s%s%s",
to_name,
to_name[strlen(to_name) - 1] == '/' ? "" : "/",
(p = strrchr(from_name, '/')) ? ++p : from_name);
to_name = pathbuf;
}