Subject: Re: bug#78416: [PATCH] * src/lread.c (get-load-suffixes): Avoid module suffix with compressed suffix

From: Lin Sun <[email-masked]>
Date: Sat, 17 May 2025 00:01:49 +0000

Update the patch towards the previous review comments. 

From 72d9694c8d7816238af3ff99c352c6568cf4e856 Mon Sep 17 00:00:00 2001
From: Lin Sun <[email-masked]>
Date: Wed, 14 May 2025 06:30:34 +0000
Subject: [PATCH] * src/lread.c (get-load-suffixes): Avoid module suffix with
 compressed suffix

---
 src/lread.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/lread.c b/src/lread.c
index 95c9e711130..89814f4fdb0 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1205,7 +1205,19 @@ DEFUN ("get-load-suffixes", Fget_load_suffixes, Sget_load_suffixes, 0, 0, 0,
       Lisp_Object exts = Vload_file_rep_suffixes;
       Lisp_Object suffix = XCAR (suffixes);
       FOR_EACH_TAIL (exts)
-	lst = Fcons (concat2 (suffix, XCAR (exts)), lst);
+	{
+	  Lisp_Object ext = XCAR (exts);
+#ifdef HAVE_MODULES
+	  if (SCHARS (ext) != 0)
+	    if (suffix_p (suffix, MODULES_SUFFIX))
+	      continue;
+# ifdef MODULES_SECONDARY_SUFFIX
+	    else if (suffix_p (suffix, MODULES_SECONDARY_SUFFIX))
+	      continue;
+# endif
+#endif
+	  lst = Fcons (concat2 (suffix, ext), lst);
+	}
     }
   return Fnreverse (lst);
 }
-- 
2.34.1