Mercurial > hg > Members > masakoha > testcode
changeset 317:fa590a7272ae
fix
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 08 May 2016 11:40:38 +0900 |
parents | c4d33b7c3ccd |
children | c9458ffecb87 |
files | regexParser/Makefile regexParser/grepWalk.cc regexParser/regexParser.cc |
diffstat | 3 files changed, 5 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- 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
--- 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);
--- 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