ssnail

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

commit 75a937005220875ebfd07a5112d2032c191d2d47
parent 2c6fea4082058ef748afe6a798ec7319ebda4d70
Author: Paco Esteban <paco@e1e0.net>
Date:   Mon, 22 Jun 2020 19:30:41 +0200

load_from_file sets errno, use it !

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

diff --git a/ssnail.c b/ssnail.c @@ -194,14 +194,14 @@ generate_index(struct listhead *h, char *head_tpl, strftime(mytime, sizeof(mytime), "%Y-%m-%d", timeInfo); if (load_from_file(&header, head_tpl) == 0) { - error = ssnail_error_msg(2, "load head_tpl"); + error = ssnail_error_from_errno("load head_tpl"); goto out; } header = str_rep(header, "$title$", "index"); header = str_rep(header, "$author$", getlogin()); header = str_rep(header, "$date$", mytime); if (load_from_file(&footer, foot_tpl) == 0) { - error = ssnail_error_msg(2, "load foot_tpl"); + error = ssnail_error_from_errno("load foot_tpl"); goto out; } footer = str_rep(footer, "$title$", "index"); @@ -339,14 +339,14 @@ write_html(struct article *ap, char *head_tpl, char *foot_tpl) } if (load_from_file(&header, head_tpl) == 0) { - error = ssnail_error_msg(2, "load header"); + error = ssnail_error_from_errno("load header"); goto out; } header = str_rep(header, "$title$", ap->title); header = str_rep(header, "$author$", ap->author); header = str_rep(header, "$date$", ap->date); if (load_from_file(&footer, foot_tpl) == 0) { - error = ssnail_error_msg(2, "load footer"); + error = ssnail_error_from_errno("load footer"); goto out; } footer = str_rep(footer, "$title$", ap->title);