diff options
Diffstat (limited to 'build2/bash/utility.hxx')
-rw-r--r-- | build2/bash/utility.hxx | 9 |
1 files changed, 4 insertions, 5 deletions
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"); } } } |