Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 May 2017 18:13:23 +0000 (UTC)
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r318069 - stable/11/usr.bin/xinstall
Message-ID:  <201705091813.v49IDNvd079289@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bdrewery
Date: Tue May  9 18:13:23 2017
New Revision: 318069
URL: https://svnweb.freebsd.org/changeset/base/318069

Log:
  MFC r303928:
  
    Trim out excessive / with -v when target directory ends with a trailing '/'.

Modified:
  stable/11/usr.bin/xinstall/xinstall.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/xinstall/xinstall.c
==============================================================================
--- stable/11/usr.bin/xinstall/xinstall.c	Tue May  9 18:12:05 2017	(r318068)
+++ stable/11/usr.bin/xinstall/xinstall.c	Tue May  9 18:13:23 2017	(r318069)
@@ -755,8 +755,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?201705091813.v49IDNvd079289>