From: Bruno Haible <bruno@clisp.org>
Date: Sun, 4 May 2025 06:19:44 +0000 (+0200)
Subject: havelib: Fix m4 underquoting bug in AC_LIB_FROMPACKAGE.
X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=f55cfe9a8f998414e801caaf62abc7d1e0e69c71;p=gnulib.git

havelib: Fix m4 underquoting bug in AC_LIB_FROMPACKAGE.

Reported for GNU clisp by Adam Sampson <ats@offog.org> at
<https://gitlab.com/gnu-clisp/clisp/-/issues/60>.

* m4/lib-link.m4 (AC_LIB_FROMPACKAGE): Protect the comma in the
expansion of [acl_libsinpackage_]PACKUP by one more level of quotes.
---

diff --git a/ChangeLog b/ChangeLog
index c0abffa5bc..97b4953372 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2025-05-04  Bruno Haible  <bruno@clisp.org>
+
+	havelib: Fix m4 underquoting bug in AC_LIB_FROMPACKAGE.
+	Reported for GNU clisp by Adam Sampson <ats@offog.org> at
+	<https://gitlab.com/gnu-clisp/clisp/-/issues/60>.
+	* m4/lib-link.m4 (AC_LIB_FROMPACKAGE): Protect the comma in the
+	expansion of [acl_libsinpackage_]PACKUP by one more level of quotes.
+
 2025-05-03  Bruno Haible  <bruno@clisp.org>
 
 	tests: Avoid compilation errors on GNU/kFreeBSD.
diff --git a/m4/lib-link.m4 b/m4/lib-link.m4
index d6de4fe2fe..1863f4e168 100644
--- a/m4/lib-link.m4
+++ b/m4/lib-link.m4
@@ -1,5 +1,5 @@
 # lib-link.m4
-# serial 34
+# serial 35
 dnl Copyright (C) 2001-2025 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -170,7 +170,7 @@ AC_DEFUN([AC_LIB_FROMPACKAGE],
   pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
                                      [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
   define([acl_libsinpackage_]PACKUP,
-    m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1])
+    m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[[, ]]],)[lib$1])
   popdef([PACKUP])
   popdef([PACK])
 ])