ssnail

crappy and opinionated static site generator
git clone https://git.e1e0.net/ssnail.git
Log | Files | Refs | README | LICENSE

commit 991ea6f0a6b5d6d54eaf85aa2c2471a722b5e0c1
parent 92cc91f7591a51e97a93a2c2a77409fc21228013
Author: Paco Esteban <paco@e1e0.net>
Date:   Thu,  2 Jul 2020 17:43:16 +0200

fix html file name from dst_path on rss and index

Diffstat:
Mssnail.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ssnail.c b/ssnail.c @@ -33,7 +33,7 @@ #include "helpers.h" #include "ssnail_error.h" -#define VERSION "1.1" +#define VERSION "1.2" struct article { size_t htmlz; @@ -566,7 +566,7 @@ add_index_entry(char **index_listing, struct article *a) const char *entry_format = "%s<li><a href=\"%s\" title=\"%s\">%s</a></li>\n"; - char *href = strstr(a->dst_path, "/"); + char *href = strrchr(a->dst_path, '/'); if (href) asprintf(index_listing, entry_format, *index_listing, @@ -626,7 +626,7 @@ add_rss_entry(char **rss_listing, struct article *a, char *url) goto out; content = strndup(a->html_content, a->htmlz); - html_file = strstr(a->dst_path, "/") + 1; + html_file = strrchr(a->dst_path, '/') + 1; if (html_file) link = build_full_path(url, html_file);