From e9bdbd12ca286b158b04e1f5eb1f2313f1e4766c Mon Sep 17 00:00:00 2001 From: Goran Jelic-Cizmek Date: Mon, 16 Dec 2024 15:58:49 +0100 Subject: [PATCH] Fix regex --- src/oc/fileio.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/oc/fileio.cpp b/src/oc/fileio.cpp index 37a95cc835..e274cf4c29 100644 --- a/src/oc/fileio.cpp +++ b/src/oc/fileio.cpp @@ -563,8 +563,8 @@ static void hoc_load(const char* stype) { ++i; const Symbol* sym = hoc_lookup(s); if (!sym || sym->type == UNDEF) { - auto file = search_hoc_files_regex(std::regex("^(func|proc|begintemplate)"), - default_search_paths()); + auto pattern = std::regex(fmt::format("^{} {}", stype, s)); + auto file = search_hoc_files_regex(pattern, default_search_paths()); if (file) { fprintf(stderr, "Getting %s from %s\n", s, file->c_str()); hoc_Load_file(0, file->c_str());