Skip to content

Commit 964174e

Browse files
07Gondvsemozhetbyt
authored andcommittedApr 20, 2019
tools,doc: fix 404 broken links in docs
Change the `linkManPages()` function to catch the `uname` and `curl` correct websites on the docs page. PR-URL: #27168 Fixes: #26074 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent 8d901bb commit 964174e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
 

‎tools/doc/html.js

+10
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ function preprocessText() {
120120

121121
// Syscalls which appear in the docs, but which only exist in BSD / macOS.
122122
const BSD_ONLY_SYSCALLS = new Set(['lchmod']);
123+
const LINUX_DIE_ONLY_SYSCALLS = new Set(['uname']);
124+
const HAXX_ONLY_SYSCALLS = new Set(['curl']);
123125
const MAN_PAGE = /(^|\s)([a-z.]+)\((\d)([a-z]?)\)/gm;
124126

125127
// Handle references to man pages, eg "open(2)" or "lchmod(2)".
@@ -136,6 +138,14 @@ function linkManPages(text) {
136138
return `${beginning}<a href="https://www.freebsd.org/cgi/man.cgi` +
137139
`?query=${name}&sektion=${number}">${displayAs}</a>`;
138140
}
141+
if (LINUX_DIE_ONLY_SYSCALLS.has(name)) {
142+
return `${beginning}<a href="https://linux.die.net/man/` +
143+
`${number}/${name}">${displayAs}</a>`;
144+
}
145+
if (HAXX_ONLY_SYSCALLS.has(name)) {
146+
return `${beginning}<a href="https://${name}.haxx.se/docs/manpage.html">${displayAs}</a>`;
147+
}
148+
139149
return `${beginning}<a href="http://man7.org/linux/man-pages/man${number}` +
140150
`/${name}.${number}${optionalCharacter}.html">${displayAs}</a>`;
141151
});

0 commit comments

Comments
 (0)
Please sign in to comment.