--- parser3/src/targets/cgi/parser3.C 2001/05/19 19:10:20 1.84 +++ parser3/src/targets/cgi/parser3.C 2001/05/21 08:05:52 1.89 @@ -5,7 +5,7 @@ Author: Alexander Petrosyan (http://design.ru/paf) - $Id: parser3.C,v 1.84 2001/05/19 19:10:20 parser Exp $ + $Id: parser3.C,v 1.89 2001/05/21 08:05:52 parser Exp $ */ #include "pa_config_includes.h" @@ -52,7 +52,8 @@ static LONG WINAPI TopLevelExceptionFilt #endif // SAPI -// appends to parser3.log located beside my binary + +// appends to parser3.log located beside my binary if openable, to stderr otherwize void SAPI::log(Pool& pool, const char *fmt, ...) { bool opened; FILE *f=0; @@ -83,6 +84,8 @@ void SAPI::log(Pool& pool, const char *f if(opened) fclose(f); + else + fflush(f); } const char *SAPI::get_env(Pool& pool, const char *name) { @@ -254,7 +257,7 @@ int main(int argc, char *argv[]) { // prepare to process request Request request(pool, request_info, - true ||cgi ? String::UL_USER_HTML : String::UL_AS_IS + cgi ? String::UL_USER_HTML : String::UL_AS_IS ); // some root-controlled location @@ -269,8 +272,13 @@ int main(int argc, char *argv[]) { // beside by binary static char site_auto_path[MAX_STRING]; - strncpy(site_auto_path, argv[0], MAX_STRING); // filespec of my binary - rsplit(site_auto_path, '/'); rsplit(site_auto_path, '\\');// strip filename + strncpy(site_auto_path, argv0, MAX_STRING); // filespec of my binary + if(!( + rsplit(site_auto_path, '/') || + rsplit(site_auto_path, '\\'))) { // strip filename + // no path, just filename + site_auto_path[0]='.'; site_auto_path[1]=0; + } // process the request request.core(