MCPcopy Create free account
hub / github.com/git/git / get_html_page_path

Function get_html_page_path

builtin/help.c:541–563  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

539}
540
541static void get_html_page_path(struct strbuf *page_path, const char *page)
542{
543 struct stat st;
544 const char *path = html_path;
545 char *to_free = NULL;
546
547 if (!path)
548 path = to_free = system_path(GIT_HTML_PATH);
549
550 /*
551 * Check that the page we're looking for exists.
552 */
553 if (!strstr(path, "://")) {
554 if (stat(mkpath("%s/%s.html", path, page), &st)
555 || !S_ISREG(st.st_mode))
556 die("'%s/%s.html': documentation file not found.",
557 path, page);
558 }
559
560 strbuf_init(page_path, 0);
561 strbuf_addf(page_path, "%s/%s.html", path, page);
562 free(to_free);
563}
564
565static void open_html(const char *path)
566{

Callers 1

show_html_pageFunction · 0.85

Calls 6

system_pathFunction · 0.85
mkpathFunction · 0.85
strbuf_initFunction · 0.85
strbuf_addfFunction · 0.85
statClass · 0.70
dieFunction · 0.50

Tested by

no test coverage detected