# HG changeset patch # User Shinji KONO # Date 1462675238 -32400 # Node ID fa590a7272aebd461444892e75917c1e7a0da9aa # Parent c4d33b7c3ccd44a2b76654c9ab34e1a29417aa96 fix diff -r c4d33b7c3ccd -r fa590a7272ae regexParser/Makefile --- a/regexParser/Makefile Sat May 07 19:41:48 2016 +0900 +++ b/regexParser/Makefile Sun May 08 11:40:38 2016 +0900 @@ -1,6 +1,6 @@ TARGET= regexParser test/ccMerge -CFLAGS= -Wall -O -g -I$(CERIUM)/include/TaskManager -I. -SEQCFLAGS= -Wall -O -g -I$(CERIUM)/include/TaskManager -I. +CFLAGS= -Wall -O0 -g -I$(CERIUM)/include/TaskManager -I. +SEQCFLAGS= -Wall -O0 -g -I$(CERIUM)/include/TaskManager -I. CC= clang++ CbC= /usr/local/Cellar/cbc/llvm3.8/bin/clang CERIUM= ../../Cerium diff -r c4d33b7c3ccd -r fa590a7272ae regexParser/grepWalk.cc --- a/regexParser/grepWalk.cc Sat May 07 19:41:48 2016 +0900 +++ b/regexParser/grepWalk.cc Sun May 08 11:40:38 2016 +0900 @@ -53,10 +53,9 @@ WordPtr w; for (w = &cc->cond.w;w;w = w->next) { // match the word. - // if (not match) continue; - if (strncmp((const char *)w->word,(const char *)tsv.buff.buffptr-1,w->length)) break; + if (strncmp((const char *)w->word,(const char *)tsv.buff.buffptr-1,w->length)==0) break; } - if (!w) continue; + if (!w) continue; // if (not match) continue; tsv.buff.buffptr += w->length - 1; } state = nextState(cc->nextState,tg); diff -r c4d33b7c3ccd -r fa590a7272ae regexParser/regexParser.cc --- a/regexParser/regexParser.cc Sat May 07 19:41:48 2016 +0900 +++ b/regexParser/regexParser.cc Sun May 08 11:40:38 2016 +0900 @@ -76,7 +76,7 @@ while (ri->tokenType == 'a') { token(ri); } - cc->cond.w.length = ri->ptr - word; + cc->cond.w.length = ri->ptr - word - 1; if (cc->cond.w.length > 1) cc->cond.w.word = word; } else