From 60bff8d54996d55ffc81995bcb63510686863c84 Mon Sep 17 00:00:00 2001 From: Phil Christensen Date: Wed, 10 Jul 2019 11:36:37 -0700 Subject: allow spaces in pathname on linux (#7216) --- toolsrc/src/vcpkg/base/hash.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/toolsrc/src/vcpkg/base/hash.cpp b/toolsrc/src/vcpkg/base/hash.cpp index 310b8c35e..e9a7fa2ef 100644 --- a/toolsrc/src/vcpkg/base/hash.cpp +++ b/toolsrc/src/vcpkg/base/hash.cpp @@ -178,9 +178,11 @@ namespace vcpkg::Hash static std::string parse_shasum_output(const std::string& shasum_output) { std::vector split = Strings::split(shasum_output, " "); + // Checking if >= 3 because filenames with spaces will show up as multiple tokens. + // The hash is the first token so we don't need to parse the filename anyway. Checks::check_exit(VCPKG_LINE_INFO, - split.size() == 3, - "Expected output of the form [hash filename\n] (3 tokens), but got\n" + split.size() >= 3, + "Expected output of the form [hash filename\n] (3+ tokens), but got\n" "[%s] (%s tokens)", shasum_output, std::to_string(split.size())); -- cgit v1.2.3