Bug 526112 - man2html rejects inter-manpage URLs for man sections such as "3pm", "3ssl", "3stap"
Summary: man2html rejects inter-manpage URLs for man sections such as "3pm", "3ssl", "...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: man
Version: 11
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Ivana Varekova
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1077297
TreeView+ depends on / blocked
 
Reported: 2009-09-28 19:49 UTC by Frank Ch. Eigler
Modified: 2014-03-17 16:27 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1077297 (view as bug list)
Environment:
Last Closed: 2009-10-12 08:36:31 UTC


Attachments (Terms of Use)

Description Frank Ch. Eigler 2009-09-28 19:49:38 UTC
man2html.c:add_links() appears to accept only a few limited
forms of inter-manpage references such as

.IR stapprobes.iosched (3stap),

and renders them as ordinary <I> text rather than <A HREF=....>.
The code responsible for this appears to accept only "[1-9]X[a-z]*",
i.e., effectively hard-coded for Xlib pages.

This hacky little patch generalizes it:

--- man2html.c~ 2007-08-05 15:15:23.000000000 -0400
+++ man2html.c  2009-09-28 15:46:30.000000000 -0400
@@ -170,8 +170,11 @@
                  && (isalnum(f[-1]) || f[-1]=='>')
                                 /* section is n or l or starts with a digit */
                  && strchr("123456789nl", f[1])
-                 && (g-f == 2 || (g-f == 3 && isdigit(f[1]) && isalpha(f[2]))
-                              || (f[2] == 'X' && isdigit(f[1])))
+                 && (g-f == 2
+                      || (g-f == 3 && isdigit(f[1]) && isalpha(f[2]))
+                      || (g-f == 4 && isdigit(f[1]) && isalpha(f[2]) && isalpha(f[3]))
+                      || (g-f == 5 && isdigit(f[1]) && isalpha(f[2]) && isalpha(f[3]) && isalpha(f[4]))
+                      || (g-f == 6 && isdigit(f[1]) && isalpha(f[2]) && isalpha(f[3]) && isalpha(f[4]) && isalpha(f[5])))
               ) {
                /* this might be a link */
                h=f-1;

Comment 1 Ivana Varekova 2009-09-29 08:05:40 UTC
Hello, 
you are right but I'm not sure whether it is ok to have a man page in this sections (e.g. package man will not go through them they are not set in /etc/man.config configuration file). Is there any special reason to have it there?

Comment 2 Frank Ch. Eigler 2009-09-29 16:37:44 UTC
The 3ssl etc. man pages are installed under man3, so man itself does
show them.

Comment 3 Ivana Varekova 2009-09-30 06:01:39 UTC
Then the suffix should be only 3 not 3ssl, if there is a conflict then it should be solved another way, not to change suffixes.

Comment 4 Frank Ch. Eigler 2009-09-30 14:35:24 UTC
Actually it is quite valid in manpage land to have textual
subsection names after the section numbers.  Many other unixes
do this too.  It's just that man2html appears to have been
accidentally hardcoded for "X..." subsection names.

Comment 5 Ivana Varekova 2009-10-12 08:36:31 UTC
Thanks, fixed in man-1_6f-23_fc13 and man-1_6f-23_fc12.


Note You need to log in before you can comment on or make changes to this bug.