Allow consecutive points

This commit is contained in:
vvb2060 2020-05-23 11:25:18 +08:00 committed by John Wu
parent 0efa73d96c
commit 51eeb89f67

View File

@ -76,18 +76,15 @@ static bool validate(const char *s) {
for (char c; (c = *s); ++s) { for (char c; (c = *s); ++s) {
if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') ||
(c >= '0' && c <= '9') || c == '_' || c == ':') { (c >= '0' && c <= '9') || c == '_' || c == ':') {
dot = false;
continue; continue;
} }
if (c == '.') { if (c == '.') {
if (dot) // No consecutive dots
return false;
dot = true; dot = true;
continue; continue;
} }
return false; return false;
} }
return true; return dot;
} }
static int add_list(const char *pkg, const char *proc = "") { static int add_list(const char *pkg, const char *proc = "") {