Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Aug 2016 18:18:52 +0000 (UTC)
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r303928 - head/usr.bin/xinstall
Message-ID:  <201608101818.u7AIIqHZ079301@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bdrewery
Date: Wed Aug 10 18:18:51 2016
New Revision: 303928
URL: https://svnweb.freebsd.org/changeset/base/303928

Log:
  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

Modified:
  head/usr.bin/xinstall/xinstall.c

Modified: head/usr.bin/xinstall/xinstall.c
==============================================================================
--- head/usr.bin/xinstall/xinstall.c	Wed Aug 10 17:19:33 2016	(r303927)
+++ head/usr.bin/xinstall/xinstall.c	Wed Aug 10 18:18:51 2016	(r303928)
@@ -749,8 +749,9 @@ install(const char *from_name, const cha
 		}
 		/* 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;
 		}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608101818.u7AIIqHZ079301>