From 59db6ff22d090f8b47e278e9ecbeaa049ba3ba55 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Sat, 28 Sep 2019 20:48:35 +0300 Subject: Adapt to swapping of entry and pattern parameters in butl::path_match() --- libbuild2/functions-filesystem.cxx | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'libbuild2/functions-filesystem.cxx') diff --git a/libbuild2/functions-filesystem.cxx b/libbuild2/functions-filesystem.cxx index d0861ba..752f73a 100644 --- a/libbuild2/functions-filesystem.cxx +++ b/libbuild2/functions-filesystem.cxx @@ -82,8 +82,8 @@ namespace build2 // path_match() overloads (below) for details. // static bool - path_match (const path& pattern, - const path& entry, + path_match (const path& entry, + const path& pattern, const optional& start) { // If pattern and entry are both either absolute or relative and @@ -94,7 +94,7 @@ namespace build2 !pattern.empty () && !entry.empty ()); if (rel && !path_pattern_self_matching (pattern)) - return path_match (pattern, entry); + return path_match (entry, pattern); // The start directory must be specified and be absolute. // @@ -114,7 +114,7 @@ namespace build2 << info << "entry: '" << entry.representation () << "'"; } - return path_match (pattern, entry, *start); + return path_match (entry, pattern, *start); } void @@ -179,22 +179,22 @@ namespace build2 // // Name matching. // - f["path_match"] = [](string pattern, string name) + f["path_match"] = [](string name, string pattern) { - return path_match (pattern, name); + return path_match (name, pattern); }; // Path matching. // - f["path_match"] = [](path pat, path ent, optional start) + f["path_match"] = [](path ent, path pat, optional start) { - return path_match (pat, ent, start); + return path_match (ent, pat, start); }; // The semantics depends on the presence of the start directory or the // first two argument syntactic representation. // - f["path_match"] = [](names pat, names ent, optional start) + f["path_match"] = [](names ent, names pat, optional start) { auto path_arg = [] (const names& a) -> bool { @@ -205,13 +205,13 @@ namespace build2 }; return start || path_arg (pat) || path_arg (ent) - ? path_match (convert (move (pat)), // Match as paths. - convert (move (ent)), + ? path_match (convert (move (ent)), // Match as paths. + convert (move (pat)), start ? convert (move (*start)) : optional ()) - : path_match (convert (move (pat)), // Match as strings. - convert (move (ent))); + : path_match (convert (move (ent)), // Match as strings. + convert (move (pat))); }; } } -- cgit v1.1