From 765edc204d45c0eb6d31e92c661355c1bd7315a9 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 23 May 2023 17:53:07 +0300 Subject: [PATCH] ; Support SQLite3 extensions on macOS * src/sqlite.c (Fsqlite_load_extension): Support *.dylib extensions. (Bug#63653) --- src/sqlite.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/sqlite.c b/src/sqlite.c index 852e3746ef4..fd528f2b0d5 100644 --- a/src/sqlite.c +++ b/src/sqlite.c @@ -730,10 +730,12 @@ Only modules on Emacs' list of allowed modules can be loaded. */) bool do_allow = false; for (const char **allow = allowlist; *allow; allow++) { - if (strlen (*allow) < strlen (name) - && !strncmp (*allow, name, strlen (*allow)) - && (!strcmp (name + strlen (*allow), ".so") - || !strcasecmp (name + strlen (*allow), ".dll"))) + ptrdiff_t allow_len = strlen (*allow); + if (allow_len < strlen (name) + && !strncmp (*allow, name, allow_len) + && (!strcmp (name + allow_len, ".so") + ||!strcmp (name + allow_len, ".dylib") + || !strcasecmp (name + allow_len, ".dll"))) { do_allow = true; break; -- 2.39.2