diff options
Diffstat (limited to 'build2/bash')
-rw-r--r-- | build2/bash/init.cxx | 2 | ||||
-rw-r--r-- | build2/bash/utility.hxx | 9 |
2 files changed, 5 insertions, 6 deletions
diff --git a/build2/bash/init.cxx b/build2/bash/init.cxx index ff653c2..7bfea58 100644 --- a/build2/bash/init.cxx +++ b/build2/bash/init.cxx @@ -54,7 +54,7 @@ namespace build2 // Install into bin/<project>/ by default stripping the .bash // extension from <project> if present. // - const string& p (cast<string> (rs.vars[var_project])); + const project_name& p (cast<project_name> (rs.vars[var_project])); install_path<bash> (bs, dir_path ("bin") /= project_base (p)); install_mode<bash> (bs, "644"); diff --git a/build2/bash/utility.hxx b/build2/bash/utility.hxx index d8d9a43..67f4552 100644 --- a/build2/bash/utility.hxx +++ b/build2/bash/utility.hxx @@ -14,13 +14,12 @@ namespace build2 { // Strip the .bash extension from the project name. // + // Note that the result may not be a valid project name. + // inline string - project_base (const string& n) + project_base (const project_name& pn) { - size_t p (path::traits::find_extension (n)); - return p == string::npos || casecmp (n.c_str () + p, ".bash", 5) != 0 - ? n - : string (n, 0, p); + return pn.base ("bash"); } } } |