aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/Paragraphs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'toolsrc/src/Paragraphs.cpp')
-rw-r--r--toolsrc/src/Paragraphs.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/toolsrc/src/Paragraphs.cpp b/toolsrc/src/Paragraphs.cpp
index d99ad45cf..f4592afed 100644
--- a/toolsrc/src/Paragraphs.cpp
+++ b/toolsrc/src/Paragraphs.cpp
@@ -41,8 +41,8 @@ namespace vcpkg::Paragraphs
static bool is_alphanum(char ch)
{
return (ch >= 'A' && ch <= 'Z')
- || (ch >= 'a' && ch <= 'z')
- || (ch >= '0' && ch <= '9');
+ || (ch >= 'a' && ch <= 'z')
+ || (ch >= '0' && ch <= '9');
}
static bool is_lineend(char ch)
@@ -153,7 +153,13 @@ namespace vcpkg::Paragraphs
std::vector<std::unordered_map<std::string, std::string>> get_paragraphs(const fs::path& control_path)
{
- return parse_paragraphs(Files::read_contents(control_path).get_or_throw());
+ const expected<std::string> contents = Files::read_contents(control_path);
+ if (auto spgh = contents.get())
+ {
+ return parse_paragraphs(*spgh);
+ }
+
+ Checks::exit_with_message("Error while reading %s: %s", control_path.generic_string(), contents.error_code().message());
}
std::vector<std::unordered_map<std::string, std::string>> parse_paragraphs(const std::string& str)