aboutsummaryrefslogtreecommitdiff
path: root/paludis/choice.cc
diff options
context:
space:
mode:
Diffstat (limited to 'paludis/choice.cc')
-rw-r--r--paludis/choice.cc27
1 files changed, 27 insertions, 0 deletions
diff --git a/paludis/choice.cc b/paludis/choice.cc
index c7a1a69..60a32e3 100644
--- a/paludis/choice.cc
+++ b/paludis/choice.cc
@@ -47,6 +47,15 @@ ChoicePrefixNameValidator::validate(const std::string & s)
break;
};
+ switch (s.at(0))
+ {
+ case ':':
+ case '_':
+ case '-':
+ throw ChoicePrefixNameError(s);
+ break;
+ };
+
if (s[0] >= 'A' && s[0] <= 'Z')
throw ChoicePrefixNameError(s);
@@ -74,6 +83,15 @@ ChoiceNameWithPrefixValidator::validate(const std::string & s)
break;
};
+ switch (s.at(0))
+ {
+ case ':':
+ case '_':
+ case '-':
+ throw ChoiceNameWithPrefixError(s);
+ break;
+ };
+
if (std::string::npos != s.find(" \t\r\n"))
throw ChoiceNameWithPrefixError(s);
}
@@ -97,6 +115,15 @@ UnprefixedChoiceNameValidator::validate(const std::string & s)
break;
};
+ switch (s.at(0))
+ {
+ case ':':
+ case '_':
+ case '-':
+ throw ChoiceNameWithPrefixError(s);
+ break;
+ };
+
if (std::string::npos != s.find(" \t\r\n"))
throw ChoiceNameWithPrefixError(s);
}