소스 검색

add PCRE_NO_UTF8_CHECK option (#297)

option to disable utf8 checks every pcre16_exec call
Constantine Teplyakov 6 년 전
부모
커밋
562af2bd36
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/std/regexp.c

+ 1 - 1
src/std/regexp.c

@@ -104,7 +104,7 @@ HL_PRIM int hl_regexp_matched_pos( ereg *e, int m, int *len ) {
 }
 
 HL_PRIM bool hl_regexp_match( ereg *e, vbyte *s, int pos, int len ) {
-	int res = pcre16_exec(e->p,&limit,(PCRE_SPTR16)s,pos+len,pos,0,e->matches,e->nmatches * 3);
+	int res = pcre16_exec(e->p,&limit,(PCRE_SPTR16)s,pos+len,pos,PCRE_NO_UTF8_CHECK,e->matches,e->nmatches * 3);
 	e->matched = res >= 0;
 	if( res >= 0 )
 		return true;