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