aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-12-01 23:36:56 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-12-01 23:36:56 +0000
commitd8d3cc16a89eb8890dc0e7b7e3edca3ec1589372 (patch)
treece122d08b182a849dfab4ddf329200f6588ddb04
parent9a5d87f3576006804efc8df07676845407e1dece (diff)
downloadpaludis-d8d3cc16a89eb8890dc0e7b7e3edca3ec1589372.tar.gz
paludis-d8d3cc16a89eb8890dc0e7b7e3edca3ec1589372.tar.xz
-live is an scm version too
-rw-r--r--paludis/dep_list/dep_list.cc25
1 files changed, 19 insertions, 6 deletions
diff --git a/paludis/dep_list/dep_list.cc b/paludis/dep_list/dep_list.cc
index 43db2b9..1ddd666 100644
--- a/paludis/dep_list/dep_list.cc
+++ b/paludis/dep_list/dep_list.cc
@@ -812,12 +812,25 @@ namespace
bool is_scm(const QualifiedPackageName & n)
{
std::string pkg(stringify(n.package));
- if (pkg.length() < 5)
- return false;
- if (0 == pkg.compare(pkg.length() - 4, 4, "-cvs"))
- return true;
- if (0 == pkg.compare(pkg.length() - 4, 4, "-svn"))
- return true;
+ switch (pkg.length())
+ {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ return false;
+
+ case 4:
+ if (0 == pkg.compare(pkg.length() - 4, 4, "-cvs"))
+ return true;
+ if (0 == pkg.compare(pkg.length() - 4, 4, "-svn"))
+ return true;
+
+ /* fall through */
+ default:
+ if (0 == pkg.compare(pkg.length() - 5, 5, "-live"))
+ return true;
+ }
return false;
}
}