From a47d6ce8a935507fa60627e1310e427eaa0d2257 Mon Sep 17 00:00:00 2001 From: Marcus Comstedt <marcus@mc.pp.se> Date: Sun, 31 May 2020 13:20:48 +0200 Subject: [PATCH] Master: Fix program_path_to_name with PIKE_MODULE_RELOC --- lib/master.pike.in | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/master.pike.in b/lib/master.pike.in index 71f2b79617..4c2ef23bce 100644 --- a/lib/master.pike.in +++ b/lib/master.pike.in @@ -4162,6 +4162,18 @@ string program_path_to_name ( string path, string prefix = ""; array(Version) versions = reverse(sort(indices(compat_handler_cache))); +#ifdef PIKE_MODULE_RELOC + if (path == "/${PIKE_MODULE_PATH}" || has_prefix (path, "/${PIKE_MODULE_PATH}/")) { + path = path[21..]; + if (has_prefix(path, UPDIR)) { + int pos = search(path, "/", strlen(UPDIR)); + if (pos > 0 && has_prefix(path[pos..], "/modules/")) { + prefix = path[strlen(UPDIR)..pos-1] + "::"; + path = path[pos+9..]; + } + } + } else +#endif find_prefix: foreach(versions, Version version) { CompatResolver r = compat_handler_cache[version]; -- GitLab