summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sfeed_frames.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sfeed_frames.c b/sfeed_frames.c
index 0af29e0..0eff8d1 100644
--- a/sfeed_frames.c
+++ b/sfeed_frames.c
@@ -110,7 +110,7 @@ printcontent(const char *s, FILE *fp)
/* normalize path names, transform to lower-case and replace non-alpha and
* non-digit with '-' */
static size_t
-normalizepathname(const char *path, char *buf, size_t bufsiz)
+normalizepath(const char *path, char *buf, size_t bufsiz)
{
size_t i = 0, r = 0;
@@ -158,8 +158,10 @@ main(int argc, char *argv[])
comparetime = time(NULL) - 86400;
basepathlen = strlen(basepath);
- if(basepathlen > 0)
+ if(basepathlen > 0) {
mkdir(basepath, S_IRWXU);
+ xerr(1, "mkdir: %s", basepath);
+ }
/* write main index page */
esnprintf(dirpath, sizeof(dirpath), "%s/index.html", basepath);
if(!(fpindex = fopen(dirpath, "w+b")))
@@ -189,7 +191,7 @@ main(int argc, char *argv[])
/* first of feed section or new feed section (differ from previous). */
if(!totalfeeds || strcmp(fcur->name, feedname)) {
/* make directory for feedname */
- if(!(namelen = normalizepathname(feedname, name, sizeof(name))))
+ if(!(namelen = normalizepath(feedname, name, sizeof(name))))
continue;
esnprintf(dirpath, sizeof(dirpath), "%s/%s", basepath, name);
@@ -225,7 +227,7 @@ main(int argc, char *argv[])
totalfeeds++;
}
/* write content */
- if(!(namelen = normalizepathname(fields[FieldTitle], name, sizeof(name))))
+ if(!(namelen = normalizepath(fields[FieldTitle], name, sizeof(name))))
continue;
esnprintf(filepath, sizeof(filepath), "%s/%s.html", dirpath, name);
esnprintf(relfilepath, sizeof(relfilepath), "%s/%s.html", reldirpath, name);