saait

Simple static page generator
git clone https://git.sinitax.com/codemadness/saait
Log | Files | Refs | README | LICENSE | Upstream | sfeed.txt

commit f2b86204b1ee8e27ceba26e05e699a1d03d2e866
parent 76dc99f57364131d08f22e79f71340334fffb1c4
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Sat, 26 Nov 2016 19:02:11 +0100

fix time

Diffstat:
Mpages/001-gothic-1-guide.cfg | 4++--
Mpages/002-getting-the-usb-powerline-bridge-to-work-on-linux.cfg | 4++--
Mpages/003-driconf-enabling-s3-texture-compression-on-linux.cfg | 4++--
Mpages/004-query-unused-css-rules-on-current-document-state.cfg | 4++--
Mpages/005-dwm-hiltjo-my-windowmanager-configuration.cfg | 4++--
Mpages/006-gtk2-theme-gtk-murrine-rape.cfg | 4++--
Mpages/007-seturgent-set-urgency-hints-for-x-applications.cfg | 4++--
Mpages/009-vim-theme-relaxed.cfg | 4++--
Mpages/010-sfeed-simple-feed-parser.cfg | 4++--
Mpages/011-userscript-block-stupid-fonts.cfg | 4++--
Mpages/012-userscript-youtube-circumvent-age-verification.cfg | 4++--
Mpages/013-userscript-focus-input-field.cfg | 4++--
Mpages/015-mg-openbsd-port.cfg | 4++--
Mpages/016-twitch-interface.cfg | 4++--
Mpages/017-openbsd-httpd-and-cgit.cfg | 4++--
Msaait.c | 19++++++-------------
16 files changed, 36 insertions(+), 43 deletions(-)

diff --git a/pages/001-gothic-1-guide.cfg b/pages/001-gothic-1-guide.cfg @@ -4,5 +4,5 @@ id=gothic-1-guide tags=game, gothic, guide keywords=gothic, game, guide, tips categories=Articles -created=2009-04-12 00:00 -updated=2009-04-12 00:00 +created=2009-04-12 +updated=2009-04-12 diff --git a/pages/002-getting-the-usb-powerline-bridge-to-work-on-linux.cfg b/pages/002-getting-the-usb-powerline-bridge-to-work-on-linux.cfg @@ -4,5 +4,5 @@ id=getting-the-usb-powerline-bridge-to-work-on-linux tags=drivers, hardware, linux keywords=int51x1, driver, linux categories=Articles -created=2009-04-13 00:00 -updated=2009-04-13 00:00 +created=2009-04-13 +updated=2009-04-13 diff --git a/pages/003-driconf-enabling-s3-texture-compression-on-linux.cfg b/pages/003-driconf-enabling-s3-texture-compression-on-linux.cfg @@ -3,5 +3,5 @@ description=driconf: enabling S3 texture compression tags=HOWTO, linux, s3tc, driconf keywords=driconf, s3tc categories=Articles -created=2009-07-05 00:00 -updated=2013-12-30 00:00 +created=2009-07-05 +updated=2013-12-30 diff --git a/pages/004-query-unused-css-rules-on-current-document-state.cfg b/pages/004-query-unused-css-rules-on-current-document-state.cfg @@ -4,6 +4,6 @@ id=query-unused-css-rules-on-current-document-state tags=programming, web keywords=css, programming categories=Articles -created=2010-04-21 00:00 -updated=2010-04-21 00:00 +created=2010-04-21 +updated=2010-04-21 diff --git a/pages/005-dwm-hiltjo-my-windowmanager-configuration.cfg b/pages/005-dwm-hiltjo-my-windowmanager-configuration.cfg @@ -3,6 +3,6 @@ description=My DWM configuration; a few added features to suit my needs tags=dwm, suckless keywords=dwm, suckless categories=Projects / applications -created=2010-08-12 00:00 -updated=2010-08-12 00:00 +created=2010-08-12 +updated=2010-08-12 diff --git a/pages/006-gtk2-theme-gtk-murrine-rape.cfg b/pages/006-gtk2-theme-gtk-murrine-rape.cfg @@ -4,6 +4,6 @@ id=gtk2-theme-gtk-murrine-rape tags=theme, gtk keywords=gtk, murrine, theme categories=Projects / applications -created=2010-10-31 00:00 -updated=2010-10-31 00:00 +created=2010-10-31 +updated=2010-10-31 diff --git a/pages/007-seturgent-set-urgency-hints-for-x-applications.cfg b/pages/007-seturgent-set-urgency-hints-for-x-applications.cfg @@ -4,6 +4,6 @@ id=seturgent-set-urgency-hints-for-x-applications tags=seturgent keywords=seturgent categories=Projects / applications -created=2010-10-31 00:00 -updated=2010-10-31 00:00 +created=2010-10-31 +updated=2010-10-31 diff --git a/pages/009-vim-theme-relaxed.cfg b/pages/009-vim-theme-relaxed.cfg @@ -3,6 +3,6 @@ description=a dark VIM theme I made and use on a daily basis tags=theme, vim keywords=vim, relaxed, theme categories=Projects / applications -created=2011-01-07 00:00 -updated=2011-01-07 00:00 +created=2011-01-07 +updated=2011-01-07 diff --git a/pages/010-sfeed-simple-feed-parser.cfg b/pages/010-sfeed-simple-feed-parser.cfg @@ -4,5 +4,5 @@ id=sfeed-simple-feed-parser tags=sfeed keywords=sfeed, rss, atom, parser, reader categories=Projects / applications -created=2011-04-01 00:00 -updated=2016-03-20 00:00 +created=2011-04-01 +updated=2016-03-20 diff --git a/pages/011-userscript-block-stupid-fonts.cfg b/pages/011-userscript-block-stupid-fonts.cfg @@ -3,6 +3,6 @@ description=Userscript to whitelist your favorite fonts and block the rest tags=userscript, greasemonkey, block fonts keywords=userscript, greasemonkey, block fonts categories=Userscript -created=2012-10-21 00:00 -updated=2012-10-21 00:00 +created=2012-10-21 +updated=2012-10-21 diff --git a/pages/012-userscript-youtube-circumvent-age-verification.cfg b/pages/012-userscript-youtube-circumvent-age-verification.cfg @@ -3,6 +3,6 @@ description=Userscript to circumvent Youtube age verification and redirect to th tags=userscript, greasemonkey, youtube, skip, circumvent, age verification keywords=userscript, greasemonkey, youtube, skip, circumvent, age verification categories=Userscript -created=2013-02-21 00:00 -updated=2013-02-21 00:00 +created=2013-02-21 +updated=2013-02-21 diff --git a/pages/013-userscript-focus-input-field.cfg b/pages/013-userscript-focus-input-field.cfg @@ -3,6 +3,6 @@ description=Userscript to focus the first input field on a page with a hotkey tags=userscript, focus, input, greasemonkey keywords=userscript, focus, input, greasemonkey categories=Userscript -created=2014-03-02 00:00 -updated=2014-03-02 00:00 +created=2014-03-02 +updated=2014-03-02 diff --git a/pages/015-mg-openbsd-port.cfg b/pages/015-mg-openbsd-port.cfg @@ -3,5 +3,5 @@ description=mg: port of OpenBSD mg version to Linux tags=mg, openbsd, port keywords=mg, openbsd, port categories=Projects -created=2014-11-23 00:00 -updated=2014-11-23 00:00 +created=2014-11-23 +updated=2014-11-23 diff --git a/pages/016-twitch-interface.cfg b/pages/016-twitch-interface.cfg @@ -3,5 +3,5 @@ description=twitch-go: web application to watch Twitch streams tags=twitch, api, Golang keywords=twitch, api, Golang categories=Projects -created=2014-11-23 00:00 -updated=2014-11-23 00:00 +created=2014-11-23 +updated=2014-11-23 diff --git a/pages/017-openbsd-httpd-and-cgit.cfg b/pages/017-openbsd-httpd-and-cgit.cfg @@ -3,5 +3,5 @@ description=OpenBSD httpd, slowcgi and cgit tags=OpenBSD httpd, slowcgi, cgit, FastCGI keywords=OpenBSD httpd, slowcgi, cgit, FastCGI categories=Projects -created=2015-07-05 00:00 -updated=2015-07-05 00:00 +created=2015-07-05 +updated=2015-07-05 diff --git a/saait.c b/saait.c @@ -415,25 +415,18 @@ main(int argc, char *argv[]) /* pages */ for (i = 1; i < argc; i++) { - r = snprintf(file, sizeof(file), "%s", argv[i]); - if (r < 0 || (size_t)r >= sizeof(file)) { - fprintf(stderr, "path truncated: '%s'\n", argv[i]); - exit(1); - } - - if ((p = strrchr(file, '.'))) - *p = '\0'; - base = estrdup(file); - if (p) - *p = '.'; + if ((p = strrchr(argv[i], '.'))) + base = estrndup(argv[i], p - argv[i]); + else + base = estrdup(argv[i]); /* read config */ - c = readconfig(file); + c = readconfig(argv[i]); /* read file data */ r = snprintf(file, sizeof(file), "%s.html", base); if (r < 0 || (size_t)r >= sizeof(file)) { - fprintf(stderr, "path truncated: '%s'\n", argv[i]); + fprintf(stderr, "path truncated: '%s.html'\n", base); exit(1); }