aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build2/parser.cxx43
1 files changed, 25 insertions, 18 deletions
diff --git a/build2/parser.cxx b/build2/parser.cxx
index 3c8e3ac..885b0c1 100644
--- a/build2/parser.cxx
+++ b/build2/parser.cxx
@@ -3879,28 +3879,35 @@ namespace build2
string t1;
const string* tp1 (tp);
- if (p == string::npos) // type
- tp1 = &val;
- else if (p == n) // directory
+ try
{
- if (dp == nullptr)
- d1 = dir_path (val);
- else
- d1 = *dp / dir_path (val);
+ if (p == string::npos) // type
+ tp1 = &val;
+ else if (p == n) // directory
+ {
+ if (dp == nullptr)
+ d1 = dir_path (val);
+ else
+ d1 = *dp / dir_path (val);
- dp1 = &d1;
- }
- else // both
- {
- t1.assign (val, p + 1, n - p);
+ dp1 = &d1;
+ }
+ else // both
+ {
+ t1.assign (val, p + 1, n - p);
- if (dp == nullptr)
- d1 = dir_path (val, 0, p + 1);
- else
- d1 = *dp / dir_path (val, 0, p + 1);
+ if (dp == nullptr)
+ d1 = dir_path (val, 0, p + 1);
+ else
+ d1 = *dp / dir_path (val, 0, p + 1);
- dp1 = &d1;
- tp1 = &t1;
+ dp1 = &d1;
+ tp1 = &t1;
+ }
+ }
+ catch (const invalid_path& e)
+ {
+ fail (t) << "invalid path '" << e.path << "'";
}
count = parse_names_trailer (