aboutsummaryrefslogtreecommitdiff
path: root/bdep/bdep.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2021-08-03 20:31:37 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2021-08-05 11:29:51 +0300
commiteb02d377f4f10e23cc6673e9e8f048b4ecbc8492 (patch)
tree3e93aa4cb405ff9207dc714c29b6321f9f9d31fa /bdep/bdep.cxx
parent562fee6a0ce42f6dd2d6acbc7d88dc9b00f50d0e (diff)
Make find_configurations() to preserve configurations order on command line
Diffstat (limited to 'bdep/bdep.cxx')
-rw-r--r--bdep/bdep.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/bdep/bdep.cxx b/bdep/bdep.cxx
index da64ce5..0229776 100644
--- a/bdep/bdep.cxx
+++ b/bdep/bdep.cxx
@@ -112,14 +112,14 @@ namespace bdep
// arguments and place them into configuration_name_options::config_name.
//
static inline bool
-cfg_name (configuration_name_options* o, const char* a)
+cfg_name (configuration_name_options* o, const char* a, size_t p)
{
string n (a);
if (n.empty ())
fail << "empty configuration name";
- o->config_name ().push_back (move (n));
+ o->config_name ().emplace_back (move (n), p);
o->config_name_specified (true);
return true;
}
@@ -182,8 +182,9 @@ init (const common_options& co,
// @<cfg-name> & -@<cfg-name>
//
- if ((*a == '@' && cfg_name (&o, a + 1)) ||
- (*a == '-' && a[1] == '@' && cfg_name (&o, a + 2)))
+ size_t p (scan.position ());
+ if ((*a == '@' && cfg_name (&o, a + 1, p)) ||
+ (*a == '-' && a[1] == '@' && cfg_name (&o, a + 2, p)))
{
scan.next ();
continue;