aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-02-05 02:47:45 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-02-05 02:47:45 +0000
commit86f214391dbef1cebfff0b3bcd9e9609ada0bfc8 (patch)
treedd5049bf4ec0bcfe2195c12c0471bd9223cfe93d
parentb089f09a601c49a1c65275178493cf2dc7fcd562 (diff)
downloadpaludis-86f214391dbef1cebfff0b3bcd9e9609ada0bfc8.tar.gz
paludis-86f214391dbef1cebfff0b3bcd9e9609ada0bfc8.tar.xz
Be a lot pickier about names that start with a -
-rw-r--r--paludis/category_name_part.cc3
-rw-r--r--paludis/package_name_part.cc2
-rw-r--r--paludis/repository_name.cc3
-rw-r--r--paludis/slot_name.cc3
-rw-r--r--paludis/use_flag_name.cc3
5 files changed, 13 insertions, 1 deletions
diff --git a/paludis/category_name_part.cc b/paludis/category_name_part.cc
index a25aeea..8ec49a1 100644
--- a/paludis/category_name_part.cc
+++ b/paludis/category_name_part.cc
@@ -36,6 +36,9 @@ CategoryNamePartValidator::validate(const std::string & s)
if (s.empty())
break;
+ if ('-' == s.at(0))
+ break;
+
if (std::string::npos != s.find_first_not_of(allowed_chars))
break;
diff --git a/paludis/package_name_part.cc b/paludis/package_name_part.cc
index 7e7131f..2ab49cc 100644
--- a/paludis/package_name_part.cc
+++ b/paludis/package_name_part.cc
@@ -39,7 +39,7 @@ PackageNamePartValidator::validate(const std::string & s)
static const std::string number_chars(
"0123456789");
- if (s.empty())
+ if (s.empty() || '-' == s.at(0))
{
Context c("When validating package name part '" + s + "':");
throw PackageNamePartError(s);
diff --git a/paludis/repository_name.cc b/paludis/repository_name.cc
index f675bf6..14e8b13 100644
--- a/paludis/repository_name.cc
+++ b/paludis/repository_name.cc
@@ -34,6 +34,9 @@ RepositoryNameValidator::validate(const std::string & s)
if (s.empty())
break;
+ if ('-' == s.at(0))
+ break;
+
if (std::string::npos != s.find_first_not_of(allowed_chars))
break;
diff --git a/paludis/slot_name.cc b/paludis/slot_name.cc
index 886bd3c..2e7a92c 100644
--- a/paludis/slot_name.cc
+++ b/paludis/slot_name.cc
@@ -39,6 +39,9 @@ SlotNameValidator::validate(const std::string & s)
if (s.empty())
break;
+ if ('-' == s.at(0))
+ break;
+
if (std::string::npos != s.find_first_not_of(allowed_chars))
break;
diff --git a/paludis/use_flag_name.cc b/paludis/use_flag_name.cc
index 8ef16c2..f6f189c 100644
--- a/paludis/use_flag_name.cc
+++ b/paludis/use_flag_name.cc
@@ -34,6 +34,9 @@ UseFlagNameValidator::validate(const std::string & s)
if (s.empty())
break;
+ if ('-' == s.at(0))
+ break;
+
if (std::string::npos != s.find_first_not_of(allowed_chars))
break;