[vcpkg] allow underscores in package name
MODIFY
src/PackageSpec.cpp
src/PackageSpec.cpp
@@ -10,7 +10,7 @@ namespace vcpkg
{
static bool is_valid_package_spec_char(char c)
{
- return (c == '-') || isdigit(c) || (isalpha(c) && islower(c)) || (c == '[') || (c == ']');
+ return (c == '-') || (c == '_') || isdigit(c) || (isalpha(c) && islower(c)) || (c == '[') || (c == ']');
}
std::string FeatureSpec::to_string() const

MODIFY
src/PackageSpecParseResult.cpp
src/PackageSpecParseResult.cpp
@@ -12,8 +12,8 @@ namespace vcpkg
case PackageSpecParseResult::SUCCESS: return "OK";
case PackageSpecParseResult::TOO_MANY_COLONS: return "Too many colons";
case PackageSpecParseResult::INVALID_CHARACTERS:
- return "Contains invalid characters. Only alphanumeric lowercase ASCII characters and dashes are "
- "allowed";
+ return "Contains invalid characters. Only alphanumeric lowercase ASCII characters, dashes and"
+ "underscores are allowed";
default: Checks::unreachable(VCPKG_LINE_INFO);
}
}

[vcpkg] allow underscores in package name