--- parser3/src/targets/cgi/parser3.C 2001/08/28 10:30:29 1.98 +++ parser3/src/targets/cgi/parser3.C 2001/08/31 15:56:46 1.100 @@ -5,7 +5,7 @@ Author: Alexander Petrosyan (http://design.ru/paf) */ -static const char *RCSId="$Id: parser3.C,v 1.98 2001/08/28 10:30:29 parser Exp $"; +static const char *RCSId="$Id: parser3.C,v 1.100 2001/08/31 15:56:46 parser Exp $"; #include "pa_config_includes.h" @@ -148,12 +148,6 @@ int main(int argc, char *argv[]) { umask(2); -#ifdef WIN32 - setmode(fileno(stdin), _O_BINARY); - setmode(fileno(stdout), _O_BINARY); - setmode(fileno(stderr), _O_BINARY); -#endif - // were we started as CGI? cgi= getenv("SERVER_SOFTWARE") || @@ -174,6 +168,12 @@ int main(int argc, char *argv[]) { } } +#ifdef WIN32 + setmode(fileno(stdin), _O_BINARY); + setmode(fileno(stdout), _O_BINARY); + setmode(fileno(stderr), _O_BINARY); +#endif + char *filespec_to_process=cgi?getenv("PATH_TRANSLATED"):argv[1]; #ifdef WIN32 back_slashes_to_slashes(filespec_to_process); @@ -309,9 +309,12 @@ int main(int argc, char *argv[]) { #ifdef WIN32 SetUnhandledExceptionFilter(0); #endif + +#ifndef WIN32 // if(!cgi) SAPI::send_body(pool, "\n", 1); +#endif // successful finish return 0; @@ -344,9 +347,11 @@ int main(int argc, char *argv[]) { if(!header_only) SAPI::send_body(pool, body, content_length); +#ifndef WIN32 // if(!cgi) SAPI::send_body(pool, "\n", 1); +#endif // unsuccessful finish return 1;