From eb02d377f4f10e23cc6673e9e8f048b4ecbc8492 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 3 Aug 2021 20:31:37 +0300 Subject: Make find_configurations() to preserve configurations order on command line --- bdep/bdep.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'bdep/bdep.cxx') 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, // @ & -@ // - 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; -- cgit v1.1