|
|
| version 1.136, 2004/03/01 08:54:16 | version 1.137, 2004/03/01 09:36:37 |
|---|---|
| Line 505 static void _trim(Request& r, MethodPara | Line 505 static void _trim(Request& r, MethodPara |
| if(params.count()>0) { | if(params.count()>0) { |
| const String& skind=params.as_string(0, | const String& skind=params.as_string(0, |
| "'where' must be string"); | "'where' must be string"); |
| if(skind==TRIM_START_OPTION) | if(skind.length()) |
| kind=String::TRIM_START; | if(skind==TRIM_START_OPTION) |
| else if(skind==TRIM_END_OPTION) | kind=String::TRIM_START; |
| kind=String::TRIM_END; | else if(skind==TRIM_END_OPTION) |
| else if(skind==TRIM_BOTH_OPTION) | kind=String::TRIM_END; |
| kind=String::TRIM_BOTH; | else if(skind==TRIM_BOTH_OPTION) |
| else | kind=String::TRIM_BOTH; |
| throw Exception("parser.runtime", | else |
| &skind, | throw Exception("parser.runtime", |
| "'kind' should be one of "TRIM_START_OPTION", "TRIM_BOTH_OPTION", "TRIM_END_OPTION); | &skind, |
| "'kind' must be one of "TRIM_START_OPTION", "TRIM_BOTH_OPTION", "TRIM_END_OPTION); | |
| if(params.count()>1) { | if(params.count()>1) { |
| const String& schars=params.as_string(1, "'chars' must be string"); | const String& schars=params.as_string(1, "'chars' must be string"); |
| if(!schars.length()) | if(schars.length()) |
| throw Exception("parser.runtime", | chars=schars.cstr(); |
| 0, | |
| "'chars' must not be empty"); | |
| chars=schars.cstr(); | |
| } | } |
| } | } |