aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Christensen <philc@microsoft.com>2019-07-10 11:36:37 -0700
committerGitHub <noreply@github.com>2019-07-10 11:36:37 -0700
commit60bff8d54996d55ffc81995bcb63510686863c84 (patch)
treebfb3461d649199215561690d54ea4e50f5ec9048
parentf97f92785f78460949a1044d417eab1d37715080 (diff)
downloadvcpkg-60bff8d54996d55ffc81995bcb63510686863c84.tar.gz
vcpkg-60bff8d54996d55ffc81995bcb63510686863c84.zip
allow spaces in pathname on linux (#7216)
-rw-r--r--toolsrc/src/vcpkg/base/hash.cpp6
1 files 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<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()));