main
cel 5 years ago
parent 2bb00d9387
commit c6bb714477
Signed by: cel
GPG Key ID: C28D95BB012367EA

@ -163,10 +163,14 @@ static int write_topbar(int fd, enum page page, const char *id, const char *titl
rc |= write_buf(fd, ">"); rc |= write_buf(fd, ">");
if (page == PAGE_ZET) { if (page == PAGE_ZET) {
if (title == NULL) {
rc |= dprintf(fd, " <a href=\"%s\"><strong><code>§%s</code></strong></a>", id, id);
} else {
rc |= dprintf(fd, " <a href=\"%s\"><strong>[", id); rc |= dprintf(fd, " <a href=\"%s\"><strong>[", id);
rc |= write_html(fd, title, strlen(title)); rc |= write_html(fd, title, strlen(title));
rc |= dprintf(fd, "](<code>§%s</code>)</strong></a>", id); rc |= dprintf(fd, "](<code>§%s</code>)</strong></a>", id);
} }
}
rc |= write_buf(fd, "</form>"); rc |= write_buf(fd, "</form>");
return rc; return rc;
@ -757,6 +761,7 @@ static int dpi_serve_zet(int fd, char *path) {
char buf[128]; char buf[128];
char *title = zet_get_title_fd(note_fd, buf, sizeof(buf)); char *title = zet_get_title_fd(note_fd, buf, sizeof(buf));
if (title == NULL) title = id;
rc = lseek(note_fd, 0, SEEK_SET); rc = lseek(note_fd, 0, SEEK_SET);
if (rc < 0) return dpi_respond_err(fd, "lseek"); if (rc < 0) return dpi_respond_err(fd, "lseek");

Loading…
Cancel
Save