allow spaces in pathname on linux (#7216)

This commit is contained in:
Phil Christensen 2019-07-10 11:36:37 -07:00 committed by GitHub
parent f97f92785f
commit 60bff8d549
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -178,9 +178,11 @@ namespace vcpkg::Hash
static std::string parse_shasum_output(const std::string& shasum_output)
{
std::vector<std::string> 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()));