--- parser3/src/classes/file.C 2009/05/14 08:10:09 1.190 +++ parser3/src/classes/file.C 2009/05/25 08:11:40 1.192 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char * const IDENT_FILE_C="$Date: 2009/05/14 08:10:09 $"; +static const char * const IDENT_FILE_C="$Date: 2009/05/25 08:11:40 $"; #include "pa_config_includes.h" @@ -401,7 +401,7 @@ static void _exec_cgi(Request& r, Method if(value_cstr) \ env.put( \ String::Body(#name), \ - String::Body(value_cstr)); \ + String::Body(*value_cstr?value_cstr:0)); \ // passing SAPI::environment if(const char *const *pairs=SAPI::environment(r.sapi_info)) { while(const char* pair=*pairs++) @@ -616,19 +616,19 @@ static void _cgi(Request& r, MethodParam static void _list(Request& r, MethodParams& params) { Value& relative_path=params.as_no_junction(0, "path must not be code"); - VRegex* vregex; + VRegex* vregex=0; VRegexCleaner vrcleaner; if(params.count()>1){ Value& regexp=params.as_no_junction(1, "regexp must not be code"); - if(Value* value=regexp.as(VREGEX_TYPE, false)){ - vregex=static_cast(value); - } else { - vregex=new VRegex(r.charsets.source(), ®exp.as_string(), 0/*options*/); - vregex->study(); - vrcleaner.vregex=vregex; + if(regexp.is_defined()){ + if(Value* value=regexp.as(VREGEX_TYPE, false)){ + vregex=static_cast(value); + } else { + vregex=new VRegex(r.charsets.source(), ®exp.as_string(), 0/*options*/); + vregex->study(); + vrcleaner.vregex=vregex; + } } - } else { - vregex=0; } const char* absolute_path_cstr=r.absolute(relative_path.as_string()).cstr(String::L_FILE_SPEC);