| 539 | } |
| 540 | |
| 541 | static 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 | |
| 565 | static void open_html(const char *path) |
| 566 | { |
no test coverage detected