[PATCH] Erlang: Use single quotes in argument to code:lib_dir(Name)

Richard Carlsson <[email protected]>
Newsgroups gmane.comp.sysutils.autoconf.patches
Message-ID <CANKG3zmBW5XdbNeHfHoUbaDqFgZjNHDoQ+hrq1_GL9+GLONBaA@mail.gmail.com>
Name should be an atom (single quotes), not a string (double quotes). The
current code works by accident, but could stop doing so in future releases
of Erlang/OTP. See http://erlang.org/doc/man/code.html#lib_dir-1

        /Richard
erlang-quoting.patch (application/octet-stream, 1 KB)
From 3f9b7a96326fd6794766cffb0e2e1850dfcca685 Mon Sep 17 00:00:00 2001
From: Richard Carlsson <[email protected]>
Date: Tue, 14 Mar 2017 16:13:07 +0100
Subject: [PATCH] Erlang: Use single quotes in argument to code:lib_dir(Name)

Name should be an atom (single quotes), not a string (double quotes). The
current code works by accident, but could stop doing so in future releases
of Erlang/OTP. See http://erlang.org/doc/man/code.html#lib_dir-1
---
 lib/autoconf/erlang.m4 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/autoconf/erlang.m4 b/lib/autoconf/erlang.m4
index c757cd1..d188f34 100644
--- a/lib/autoconf/erlang.m4
+++ b/lib/autoconf/erlang.m4
@@ -180,7 +180,7 @@ AC_CACHE_CHECK([for Erlang/OTP '$1' library subdirectory],
     [AC_LANG_PUSH(Erlang)[]dnl
      AC_RUN_IFELSE(
 	[AC_LANG_PROGRAM([], [dnl
-	    ReturnValue = case code:lib_dir("[$1]") of
+	    ReturnValue = case code:lib_dir('[$1]') of
 	    {error, bad_name} ->
 		file:write_file("conftest.out", "not found\n"),
 		1;
-- 
2.9.3
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.