aboutsummaryrefslogtreecommitdiff
path: root/mod
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2025-01-20 09:40:01 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2025-01-20 09:40:01 +0200
commit6287cfd1c0dbe34f9746980f935e4543883b3787 (patch)
treea38028e802fee68bec747ee96cdbe99235a39ff6 /mod
parent529e67abdaa0710e30afc3061c35612b2ba33517 (diff)
Review 1
Diffstat (limited to 'mod')
-rw-r--r--mod/mod-ci-github.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/mod/mod-ci-github.cxx b/mod/mod-ci-github.cxx
index b203f94..45a9d14 100644
--- a/mod/mod-ci-github.cxx
+++ b/mod/mod-ci-github.cxx
@@ -3119,12 +3119,12 @@ namespace brep
// @d2586f57-21dc-40b7-beb2-6517ad7917dd (37 characters)
// <brep-root>/@d2586f57-21dc-40b7-beb2-6517ad7917dd
//
- if (!u.path || u.path->size () < 37)
+ if (!u.path)
return nullopt;
{
- size_t p (u.path->find_first_of ('@'));
- if (p > (u.path->size () - 37))
+ size_t p (u.path->find ('@'));
+ if (p == string::npos || u.path->size () - p != 37)
return nullopt; // Tenant not found or too short.
r.package.tenant = u.path->substr (p + 1);
@@ -3183,8 +3183,8 @@ namespace brep
// Note: parsing code based on mod/mod-builds.cxx.
//
- size_t p (v.find_first_of ('-'));
- if (p >= v.size () - 1)
+ size_t p (v.find ('-'));
+ if (p == string::npos || p >= v.size () - 1)
return nullopt; // Invalid format.
r.toolchain_name = v.substr (0, p);