diff regexParser/grepWalk.cc @ 315:66012db6a717

add wordMode in grepWalk
author mir3636
date Sat, 07 May 2016 19:18:43 +0900
parents 1188debbef10
children c4d33b7c3ccd
line wrap: on
line diff
--- a/regexParser/grepWalk.cc	Sat May 07 18:38:54 2016 +0900
+++ b/regexParser/grepWalk.cc	Sat May 07 19:18:43 2016 +0900
@@ -49,8 +49,14 @@
             } else if (c<=cc->cond.range.end) {
                 // range matched.
                 if (cc->cond.w.word) {
-                    // match the word.
-                    // if (not match) continue;
+                    WordPtr w;
+                    for (w = &cc->cond.w.word;w;w = w->next) {
+                        // match the word.
+                        // if (not match) continue;
+                        if (strncmp(w.word,tsv.buff.buffptr-1,w.length)) break;
+                    }
+                    if (!w) continue;
+                    tsv.buff.buffptr += w.length - 1;
                 }
                 state = nextState(cc->nextState,tg);
                 goto next;