Default title to note id

main
cel 5 years ago
parent d0d151f86b
commit 330f281a98

@ -194,6 +194,10 @@ static char *zet_get_title(const char *id, char *buf, size_t len) {
close(fd); close(fd);
while (*buf == '#') buf++; while (*buf == '#') buf++;
while (*buf == ' ') buf++; while (*buf == ' ') buf++;
if (!*buf) {
strncpy(buf, "§", sigil_size);
strncpy(buf + sigil_size, id, len);
}
return buf; return buf;
} }
@ -623,7 +627,7 @@ static int dpi_serve_zet(int fd, char *path) {
"<title>"); "<title>");
char buf[128]; char buf[128];
char *title = zet_get_title(id, buf, sizeof(buf)); char *title = zet_get_title(id, buf, sizeof(buf));
rc |= write_html(fd, title, strlen(title)); if (title != NULL) rc |= write_html(fd, title, strlen(title));
rc |= dprintf(fd, rc |= dprintf(fd,
"</title>" "</title>"
"<meta charset=utf-8>" "<meta charset=utf-8>"

Loading…
Cancel
Save