aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build2/test/script/regex.cxx3
-rw-r--r--build2/test/script/regex.hxx3
2 files changed, 4 insertions, 2 deletions
diff --git a/build2/test/script/regex.cxx b/build2/test/script/regex.cxx
index fe8bcb0..5e14e6e 100644
--- a/build2/test/script/regex.cxx
+++ b/build2/test/script/regex.cxx
@@ -341,7 +341,8 @@ namespace std
{
const char_type& c (*b++);
- *m++ = c.type () == line_type::special && build2::digit (c.special ())
+ *m++ = c.type () == line_type::special && c.special () >= 0 &&
+ build2::digit (static_cast<char> (c.special ()))
? digit
: 0;
}
diff --git a/build2/test/script/regex.hxx b/build2/test/script/regex.hxx
index c8c3877..a3a0d2d 100644
--- a/build2/test/script/regex.hxx
+++ b/build2/test/script/regex.hxx
@@ -462,7 +462,8 @@ namespace std
is (mask m, char_type c) const
{
return m ==
- (c.type () == line_type::special && build2::digit (c.special ())
+ (c.type () == line_type::special && c.special () >= 0 &&
+ build2::digit (static_cast<char> (c.special ()))
? digit
: 0);
}