X-Git-Url: https://git.distorted.org.uk/~mdw/disorder/blobdiff_plain/812b526d127c6657e571db8b33a58137af6709cd..c8d29a75d7ad8ef5cd0b2d0109f1db4f8a3c1368:/cgi/cgimain.c diff --git a/cgi/cgimain.c b/cgi/cgimain.c index 583af30..236cca6 100644 --- a/cgi/cgimain.c +++ b/cgi/cgimain.c @@ -28,6 +28,7 @@ int main(int argc, char **argv) { progname = argv[0]; /* RFC 3875 s8.2 recommends rejecting PATH_INFO if we don't make use of * it. */ + if(!setlocale(LC_CTYPE, "")) disorder_error(errno, "error calling setlocale"); /* TODO we could make disorder/ACTION equivalent to disorder?action=ACTION */ if(getenv("PATH_INFO")) { /* TODO it might be nice to link back to the right place... */ @@ -48,7 +49,7 @@ int main(int argc, char **argv) { if(getenv("DISORDER_DEBUG")) debugging = 1; /* Read configuration */ - if(config_read(0/*!server*/)) + if(config_read(0/*!server*/, NULL)) exit(EXIT_FAILURE); /* Figure out our URL. This can still be overridden from the config file if * necessary but it shouldn't be necessary in ordinary installations. */ @@ -65,7 +66,7 @@ int main(int argc, char **argv) { mx_search_path(pkgdatadir); /* Never cache anythging */ if(printf("Cache-Control: no-cache\n") < 0) - fatal(errno, "error writing to stdout"); + disorder_fatal(errno, "error writing to stdout"); /* Create the initial connection, trying the cookie if we found a suitable * one. */ dcgi_login(); @@ -74,7 +75,7 @@ int main(int argc, char **argv) { /* In practice if a write fails that probably means the web server went away, * but we log it anyway. */ if(fclose(stdout) < 0) - fatal(errno, "error closing stdout"); + disorder_fatal(errno, "error closing stdout"); return 0; }