From 27fca704faf5db81e1657722bc4d99dd95f6c6fe Mon Sep 17 00:00:00 2001
From: Morris Jette <jette@schedmd.com>
Date: Fri, 22 Jul 2011 08:58:00 -0700
Subject: [PATCH] Better support for new man2html

The latest version of man2html used to make web pages from man pages
produces slightly different output. This patch from Rod Schultz (Bull)
will work with the latest version of man2html plus older versions.
---
 doc/man/man2html.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/doc/man/man2html.py b/doc/man/man2html.py
index bfc20feff77..b06ec3c8c4a 100755
--- a/doc/man/man2html.py
+++ b/doc/man/man2html.py
@@ -89,8 +89,10 @@ def llnl_references(line):
         return line
 
 def relative_reference(lineIn):
-    fullRef = "http://localhost/cgi-bin/man/man2html"
+    fullRef = "/cgi-bin/man/man2html"
     lenRef = len(fullRef)
+    refAnchor="<A HREF=";
+    lenRefAnchor = len(refAnchor)
     lineOt = ""
     cursor = 0
     
@@ -103,7 +105,8 @@ def relative_reference(lineIn):
             return ""
         return "<i>man2html</i> "
     while posHREF != -1:
-        lineOt = lineOt + lineIn[cursor:posHREF-1]
+        posRefAnchor = lineIn.find(refAnchor,cursor)
+        lineOt = lineOt + lineIn[cursor:posRefAnchor+lenRefAnchor]
         cursor = posHREF + lenRef + 3
         lineOt = lineOt + '"'
         posQuote = lineIn.find('"',cursor)
-- 
GitLab