From 144550c6c335df2214a24d42aa49db89091e7e78 Mon Sep 17 00:00:00 2001 From: simon Date: Mon, 22 Feb 2010 19:59:47 +0000 Subject: [PATCH] I promised in the docs that the HTML output directory would be created if it didn't exist, so I'd better actually do that. git-svn-id: svn://svn.tartarus.org/sgt/agedu@8881 cda61777-01e9-0310-a592-d414129be87e --- agedu.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/agedu.c b/agedu.c index 463104f..a8269a9 100644 --- a/agedu.c +++ b/agedu.c @@ -1369,9 +1369,14 @@ int main(int argc, char **argv) */ int dirlen = outfile ? 2+strlen(outfile) : 3; char prefix[dirlen]; - if (outfile) + if (outfile) { + if (mkdir(outfile, 0777) < 0 && errno != EEXIST) { + fprintf(stderr, "%s: %s: mkdir: %s\n", PNAME, + outfile, strerror(errno)); + return 1; + } snprintf(prefix, dirlen, "%s/", outfile); - else + } else snprintf(prefix, dirlen, "./"); unsigned long xi2; -- 2.11.0