Changeset View
Changeset View
Standalone View
Standalone View
man/man2html.cpp
Context not available. | |||||
3924 | h = name + 3; | 3924 | h = name + 3; | ||
---|---|---|---|---|---|
3925 | else | 3925 | else | ||
3926 | h = name; | 3926 | h = name; | ||
3927 | | ||||
3928 | // The format of the argument to .so varies among man pages. | ||||
3929 | // Some of them, e.g. pam.8, use "PAM.8". Others, e.g. telinit.8, | ||||
3930 | // use "man8/init.8". So they are not always true relative paths, | ||||
3931 | // although the man(1) command seems to handle them with no problem. | ||||
3932 | // | ||||
3933 | // The code above starting "h = c - 3" attempts to turn the argument | ||||
3934 | // into a relative path, but that is not correct in the case of pam.8 | ||||
3935 | // as above. So this removes the "../" prefix again if there is | ||||
3936 | // no other slash following it. | ||||
3937 | char *firstSlash = strchr(h, '/'); | ||||
3938 | if (firstSlash != 0) | ||||
3939 | { | ||||
3940 | char *nextSlash = strchr(firstSlash + 1, '/'); | ||||
3941 | if (nextSlash == 0) | ||||
3942 | h = firstSlash + 1; | ||||
3943 | } | ||||
3944 | | ||||
3927 | /* this works alright, except for section 3 */ | 3945 | /* this works alright, except for section 3 */ | ||
3928 | buf = read_man_page(h); | 3946 | buf = read_man_page(h); | ||
3929 | if (!buf) | 3947 | if (!buf) | ||
Context not available. |