Blame otp-0009-Load-man-pages-from-system-wide-directory.patch

c259dd
From: Francois-Denis Gonthier <neumann@lostwebsite.net>
c259dd
Date: Thu, 20 Sep 2018 15:01:18 +0300
c259dd
Subject: [PATCH] Load man-pages from system-wide directory
c259dd
c259dd
Patch allows one to use standard man path with erl -man command.
c259dd
(Erlang manual pages are placed to /usr/share/man/ hierarchy
c259dd
as required by Debian policy.)
c259dd
c259dd
diff --git a/erts/etc/common/erlexec.c b/erts/etc/common/erlexec.c
372de3
index 9dba684cbb..b4c5a8413f 100644
c259dd
--- a/erts/etc/common/erlexec.c
c259dd
+++ b/erts/etc/common/erlexec.c
c07d3a
@@ -727,8 +727,10 @@ int main(int argc, char **argv)
c259dd
 			error("-man not supported on Windows");
c259dd
 #else
c259dd
 			argv[i] = "man";
c259dd
-			erts_snprintf(tmpStr, sizeof(tmpStr), "%s/man", rootdir);
c259dd
-			set_env("MANPATH", tmpStr);
c259dd
+			/*
c259dd
+			* Conform to erlang-manpages content.
c259dd
+			*/
c259dd
+			putenv(strsave("MANSECT=3erl:1:5:7"));
c259dd
 			execvp("man", argv+i);
c259dd
 			error("Could not execute the 'man' command.");
c259dd
 #endif