From 891995d3d1fdc5ad0dbd63b8ab2c54e877c0c2f9 Mon Sep 17 00:00:00 2001 From: Gabriel Ferreira Date: Sat, 26 Jul 2025 19:12:44 +0200 Subject: [PATCH] bindings: Improve library matching regex It was incorrectly matching libbacktrace error messages --- bindings/python/ns__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/python/ns__init__.py b/bindings/python/ns__init__.py index a82e99b83..716e29bc9 100644 --- a/bindings/python/ns__init__.py +++ b/bindings/python/ns__init__.py @@ -177,7 +177,7 @@ def extract_linked_libraries(library_name: str, prefix: str) -> tuple: try: with open(os.path.abspath(library_path), "rb") as f: linked_libs = re.findall( - b"\x00(lib.*?.%b)" % LIBRARY_EXTENSION.encode("utf-8"), f.read() + b"\x00(lib[^\\x00]*?\\.%b)(?![\\w.])" % LIBRARY_EXTENSION.encode("utf-8"), f.read() ) except Exception as e: print(f"Failed to extract libraries used by {library_path} with exception:{e}")