Blame otp-0010-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
c259dd
index 793cb532b3..2368a2c97b 100644
c259dd
--- a/erts/etc/common/erlexec.c
c259dd
+++ b/erts/etc/common/erlexec.c
c259dd
@@ -712,8 +712,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