--- parser3/src/targets/cgi/parser3.C 2001/05/21 08:01:36 1.87 +++ parser3/src/targets/cgi/parser3.C 2001/08/24 09:27:53 1.96 @@ -4,9 +4,8 @@ Copyright(c) 2001 ArtLebedev Group(http://www.artlebedev.com) Author: Alexander Petrosyan (http://design.ru/paf) - - $Id: parser3.C,v 1.87 2001/05/21 08:01:36 parser Exp $ */ +static const char *RCSId="$Id: parser3.C,v 1.96 2001/08/24 09:27:53 parser Exp $"; #include "pa_config_includes.h" @@ -272,11 +271,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 - printf("content-type:text/plain\n\nr=%s, s=%s", - root_auto_path, - site_auto_path); + 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( @@ -296,6 +297,10 @@ int main(int argc, char *argv[]) { #ifdef WIN32 SetUnhandledExceptionFilter(0); #endif + // + if(!cgi) + SAPI::send_body(pool, "\n", 1); + // successful finish return 0; } PCATCH(e) { // global problem @@ -327,6 +332,10 @@ int main(int argc, char *argv[]) { if(!header_only) SAPI::send_body(pool, body, content_length); + // + if(!cgi) + SAPI::send_body(pool, "\n", 1); + // unsuccessful finish return 1; }