| 2060 | } |
| 2061 | |
| 2062 | int loadExpression(expressionObj *exp) |
| 2063 | { |
| 2064 | /* TODO: should we fall freeExpression if exp->string != NULL? We do some checking to avoid a leak but is it enough... */ |
| 2065 | |
| 2066 | msyystring_icase = MS_TRUE; |
| 2067 | if((exp->type = getSymbol(5, MS_STRING,MS_EXPRESSION,MS_REGEX,MS_ISTRING,MS_IREGEX)) == -1) return(-1); |
| 2068 | if (exp->string != NULL) |
| 2069 | msFree(exp->string); |
| 2070 | exp->string = msStrdup(msyystring_buffer); |
| 2071 | |
| 2072 | if(exp->type == MS_ISTRING) { |
| 2073 | exp->flags = exp->flags | MS_EXP_INSENSITIVE; |
| 2074 | exp->type = MS_STRING; |
| 2075 | } else if(exp->type == MS_IREGEX) { |
| 2076 | exp->flags = exp->flags | MS_EXP_INSENSITIVE; |
| 2077 | exp->type = MS_REGEX; |
| 2078 | } |
| 2079 | |
| 2080 | return(0); |
| 2081 | } |
| 2082 | |
| 2083 | /* --------------------------------------------------------------------------- |
| 2084 | msLoadExpressionString and loadExpressionString |