• R/O
  • SSH
  • HTTPS

tsukurimashou: Commit


Commit MetaInfo

Revision301 (tree)
Time2012-07-27 09:19:51
Authormskala

Log Message

testing for regex match

Change Summary

Incremental Difference

--- trunk/idsgrep/regex.c (revision 300)
+++ trunk/idsgrep/regex.c (revision 301)
@@ -49,8 +49,8 @@
4949 pcre_study(ms->nc_needle->child[0]->head->pcre_compiled,
5050 0,&errptr);
5151 if (errptr) {
52- printf("PCRE error: %s.\n",errptr);
53- exit(1);
52+ printf("PCRE error: %s.\n",errptr); /* SNH */
53+ exit(1); /* SNH */
5454 }
5555 }
5656 ms->match_result=
@@ -81,19 +81,19 @@
8181 pcre_study(ms->nc_needle->child[0]->functor->pcre_compiled,
8282 0,&errptr);
8383 if (errptr) {
84- printf("PCRE error: %s.\n",errptr);
85- exit(1);
84+ printf("PCRE error: %s.\n",errptr); /* SNH */
85+ exit(1); /* SNH */
8686 }
87- if (pcre_exec(ms->nc_needle->child[0]->functor->pcre_compiled,
88- ms->nc_needle->child[0]->functor->pcre_studied,
89- ms->nc_haystack->head->data,
90- ms->nc_haystack->head->length,
91- 0,PCRE_NO_UTF8_CHECK,NULL,0)<0) {
92- ms->match_result=MR_FALSE;
93- return ms;
94- }
9587 }
96-
88+ if (pcre_exec(ms->nc_needle->child[0]->functor->pcre_compiled,
89+ ms->nc_needle->child[0]->functor->pcre_studied,
90+ ms->nc_haystack->functor->data,
91+ ms->nc_haystack->functor->length,
92+ 0,PCRE_NO_UTF8_CHECK,NULL,0)<0) {
93+ ms->match_result=MR_FALSE;
94+ return ms;
95+ }
96+
9797 if (ms->nc_needle->child[0]->arity==0) {
9898 ms->match_result=MR_TRUE;
9999 return ms;
--- trunk/idsgrep/hash.c (revision 300)
+++ trunk/idsgrep/hash.c (revision 301)
@@ -79,12 +79,12 @@
7979 while ((((size_t)1)<<i)<=s->length) i++;
8080 s->next=free_strings[i];
8181 if (s->pcre_compiled) {
82- free(s->pcre_compiled);
83- s->pcre_compiled=NULL;
82+ free(s->pcre_compiled); /* SNH */
83+ s->pcre_compiled=NULL; /* SNH */
8484 }
8585 if (s->pcre_studied) {
86- free(s->pcre_studied);
87- s->pcre_studied=NULL;
86+ free(s->pcre_studied); /* SNH */
87+ s->pcre_studied=NULL; /* SNH */
8888 }
8989 free_strings[i]=s;
9090 }
--- trunk/idsgrep/Makefile.am (revision 300)
+++ trunk/idsgrep/Makefile.am (revision 301)
@@ -120,7 +120,7 @@
120120 GCOV_TESTS = \
121121 test/andor test/anynot test/assoc test/basicmatch test/backslash \
122122 test/bighash test/demorgan test/equal test/kvg-grone test/messages \
123- test/spacing test/tsu-grone test/unord test/utf8
123+ test/regex test/spacing test/tsu-grone test/unord test/utf8
124124
125125 define GCDEP_RECIPE
126126 $1.log: test/rmgcda.log
Show on old repository browser