man.patch by Francois-Denis Gonthier <neumann@lostwebsite.net>

Patch allows to use standard man path with erl -man command.
(Erlang manual pages are placed to /usr/share/man/ hierarchy
as required by Debian policy.)

--- erlang-14.a-dfsg.orig/erts/etc/common/erlexec.c
+++ erlang-14.a-dfsg/erts/etc/common/erlexec.c
@@ -707,8 +707,10 @@
 			error("-man not supported on Windows");
 #else
 			argv[i] = "man";
-			sprintf(tmpStr, "%s/man", rootdir);
-			set_env("MANPATH", tmpStr);
+			/*
+			* Conform to erlang-manpages content.
+			*/
+			putenv(strsave("MANSECT=3erl:1:5:7"));
 			execvp("man", argv+i);
 			error("Could not execute the 'man' command.");
 #endif
