aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-12-31 01:49:40 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-12-31 01:49:40 +0000
commit8d4ad57e77529de383c839ece5540414f29543a1 (patch)
tree45635abacc9803dd652f4d3ea232c6ccfedb1d90
parent4b4131e63f99eed55840d9154acdcb5c497277e0 (diff)
downloadpaludis-8d4ad57e77529de383c839ece5540414f29543a1.tar.gz
paludis-8d4ad57e77529de383c839ece5540414f29543a1.tar.xz
Disallow dots at the start of names
-rw-r--r--paludis/name.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/paludis/name.cc b/paludis/name.cc
index a85cb70..b0e9436 100644
--- a/paludis/name.cc
+++ b/paludis/name.cc
@@ -57,7 +57,7 @@ UseFlagNameValidator::validate(const std::string & s)
if (s.empty())
break;
- if ('-' == s.at(0))
+ if ('-' == s.at(0) || '.' == s[0])
break;
if (std::string::npos != s.find_first_not_of(allowed_chars))
@@ -95,7 +95,7 @@ SlotNameValidator::validate(const std::string & s)
if (s.empty())
break;
- if ('-' == s.at(0))
+ if ('-' == s.at(0) || '.' == s[0])
break;
if (std::string::npos != s.find_first_not_of(allowed_chars))
@@ -128,7 +128,7 @@ PackageNamePartValidator::validate(const std::string & s)
static const std::string number_chars(
"0123456789");
- if (s.empty() || '-' == s.at(0))
+ if (s.empty() || '-' == s.at(0) || '.' == s[0])
{
Context c("When validating package name part '" + s + "':");
throw PackageNamePartError(s);
@@ -166,7 +166,7 @@ CategoryNamePartValidator::validate(const std::string & s)
if (s.empty())
break;
- if ('-' == s.at(0))
+ if ('-' == s.at(0) || '.' == s[0])
break;
if (std::string::npos != s.find_first_not_of(allowed_chars))
@@ -198,7 +198,7 @@ RepositoryNameValidator::validate(const std::string & s)
if (s.empty())
break;
- if ('-' == s.at(0))
+ if ('-' == s.at(0) || '.' == s[0])
break;
if (std::string::npos != s.find_first_not_of(allowed_chars))
@@ -309,7 +309,7 @@ SetNameValidator::validate(const std::string & s)
if (s.empty())
break;
- if ('-' == s.at(0))
+ if ('-' == s.at(0) || '.' == s[0])
break;
if (std::string::npos != s.find_first_not_of(allowed_chars))