|
发表于 2012-7-27 19:41:19
|
显示全部楼层
我查了一下ytin的源码,粗略浏览下,貌似没有对$的限制,只有对^的限制:(见源码17行)- /******************************************************************/
- /* check if a text triggers an action and fill into the variables */
- /* return TRUE if triggered */
- /******************************************************************/
- int check_a_action(const char *line, const char *action, struct session* ses)
- {
- char result[BUFFER_SIZE];
- char *temp2, *tptr = result;
- const char *line2;
- int i, len, flag;
-
- for(i = 0; i < 10; i++)
- var_len[i] = -1;
- substitute_myvars(action, result, ses);
-
- if(*tptr == '^') {
- if((len = match_a_string(line, ++tptr)) == -1)
- return(FALSE);
- line += len;
- tptr += len;
- }
- else {
- flag = TRUE;
- len = -1;
- while(*line && flag)
- if((len = match_a_string(line, tptr)) != -1)
- flag = FALSE;
- else
- line++;
-
- if(len != -1) {
- line += len;
- tptr += len;
- }
- else
- return(FALSE);
- }
-
- while(*line && *tptr) {
- temp2 = tptr+2;
- if(!*temp2) {
- var_len[tptr[1]-'0'] = strlen(line);
- var_ptr[tptr[1]-'0'] = line;
- return(TRUE);
- }
-
- line2 = line;
- flag = TRUE;
- len = -1;
-
- while(*line2 && flag)
- if((len = match_a_string(line2, temp2)) != -1)
- flag = FALSE;
- else
- line2++;
-
- if(len != -1) {
- var_len[tptr[1]-'0'] = line2-line;
- var_ptr[tptr[1]-'0'] = line;
- line = line2+len;
- tptr = temp2+len;
- }
- else
- return(FALSE);
- }
-
- return(*tptr ? FALSE : TRUE);
- }
复制代码 |
|