--- parser3/src/targets/cgi/parser3.C 2002/06/24 11:59:33 1.184 +++ parser3/src/targets/cgi/parser3.C 2002/08/01 11:41:21 1.190 @@ -3,10 +3,10 @@ Copyright(c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) - - $Id: parser3.C,v 1.184 2002/06/24 11:59:33 paf Exp $ */ +static const char* IDENT_PARSER3_C="$Date: 2002/08/01 11:41:21 $"; + #include "pa_config_includes.h" #if _MSC_VER @@ -31,7 +31,7 @@ //#define DEBUG_POOL_MALLOC //#define DEBUG_STRING_APPENDS_VS_EXPANDS -//#define DEBUG_MAIL_RECEIVE "test2.eml" +#define DEBUG_MAILRECEIVE "koi.eml" #ifdef DEBUG_STRING_APPENDS_VS_EXPANDS extern ulong @@ -43,28 +43,6 @@ extern ulong // consts -#ifndef _PROFILE -extern const char *main_RCSIds[]; -#ifdef USE_SMTP -extern const char *smtp_RCSIds[]; -#endif -extern const char *gd_RCSIds[]; -extern const char *classes_RCSIds[]; -extern const char *types_RCSIds[]; -extern const char *parser3_RCSIds[]; -const char **RCSIds[]={ - main_RCSIds, -#ifdef USE_SMTP - smtp_RCSIds, -#endif - gd_RCSIds, - classes_RCSIds, - types_RCSIds, - parser3_RCSIds, - 0 -}; -#endif - #define REDIRECT_PREFIX "REDIRECT_" #define PARSER_CONFIG_ENV_NAME "CGI_PARSER_CONFIG" @@ -250,7 +228,7 @@ static void real_parser_handler( // init global variables pa_globals_init(*pool); - if(!filespec_to_process) + if(!filespec_to_process || !*filespec_to_process) SAPI::die("Parser/%s", PARSER_VERSION); // Request info @@ -416,13 +394,13 @@ static void failed_new() { #endif static void usage(const char *program) { - fprintf(stderr, + printf( "Parser/%s Copyright(c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com)\n" "Author: Alexandr Petrosian (http://paf.design.ru)\n" "\n" "Usage: %s [options] file\n" "Options are:\n" -#ifdef WITH_MAIL_RECEIVE +#ifdef WITH_MAILRECEIVE " -m Parse mail, put received letter to $mail:received\n" #endif " -h Display usage information (this message)\n" @@ -436,8 +414,8 @@ int main(int argc, char *argv[]) { Pool global_pool(&global_pool_storage); pool=&global_pool; -#ifdef DEBUG_MAIL_RECEIVE - if(FILE *fake_in=fopen(DEBUG_MAIL_RECEIVE, "rt")) { +#ifdef DEBUG_MAILRECEIVE + if(FILE *fake_in=fopen(DEBUG_MAILRECEIVE, "rt")) { dup2(fake_in->_file, 0/*STDIN_FILENO*/); } #endif @@ -465,7 +443,7 @@ int main(int argc, char *argv[]) { opterr = 0; int c; while((c = getopt(argc, argv, "h" -#ifdef WITH_MAIL_RECEIVE +#ifdef WITH_MAILRECEIVE "m" #endif )) > 0) { @@ -473,7 +451,7 @@ int main(int argc, char *argv[]) { case 'h': usage(argv[0]); break; -#ifdef WITH_MAIL_RECEIVE +#ifdef WITH_MAILRECEIVE case 'm': mail_received=true; break;