diff options
Diffstat (limited to 'rss.c')
-rw-r--r-- | rss.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -1,4 +1,7 @@ +#include <errno.h> +#include <stdio.h> #include <stdlib.h> +#include <string.h> #include "config.h" #include "sm.h" @@ -61,7 +64,12 @@ rssexport(Document **doc, int ndoc) qsort(doc, ndoc, sizeof(*doc), (int (*)(const void *, const void *))creatcompar); - outf = xfopen(krssexport, "w"); + if (!mkparentdirs(krssexport)) + return; + if ((outf = fopen(krssexport, "w")) == NULL) { + fprintf(stderr, "%s: %s\n", krssexport, strerror(errno)); + return; + } for (j = 0; j < LEN(header); j++) xfputs(header[j], outf); for (i = 0; i < ndoc; i++) { |