--- parser3/src/targets/cgi/parser3.C 2001/05/21 07:32:04 1.85 +++ parser3/src/targets/cgi/parser3.C 2001/06/28 07:41:59 1.92 @@ -5,8 +5,9 @@ Author: Alexander Petrosyan (http://design.ru/paf) - $Id: parser3.C,v 1.85 2001/05/21 07:32:04 parser Exp $ + $Id: parser3.C,v 1.92 2001/06/28 07:41:59 parser Exp $ */ +static char *RCSId="$Id: parser3.C,v 1.92 2001/06/28 07:41:59 parser Exp $"; #include "pa_config_includes.h" @@ -52,7 +53,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; @@ -256,7 +258,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 @@ -271,8 +273,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(