diff options
author | Adrian Thurston <thurston@complang.org> | 2013-01-27 14:31:14 -0500 |
---|---|---|
committer | Adrian Thurston <thurston@complang.org> | 2013-01-27 14:31:14 -0500 |
commit | d2d780618386860d7fb6260579ca705f8bb902e8 (patch) | |
tree | 7f5d18120286801a08734d614c3e5c12461e6bcf | |
parent | 73d0bdf8c771116da360cf8cf4b075f4d8431db6 (diff) | |
download | colm-d2d780618386860d7fb6260579ca705f8bb902e8.tar.gz |
repeatedly call getData in match extraction
The getData interface was originally designed to stop on buffer boundaries.
Need to call it in a loop when using it in extractMatch.
-rw-r--r-- | colm/pdarun.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/colm/pdarun.c b/colm/pdarun.c index a334f358..f762689d 100644 --- a/colm/pdarun.c +++ b/colm/pdarun.c @@ -817,7 +817,14 @@ Head *extractMatch( Program *prg, FsmRun *fsmRun, StreamImpl *is ) fsmRun->consumeBuf = runBuf; int lenCopied = 0; + int total = 0; is->funcs->getData( fsmRun, is, 0, runBuf->data, length, &lenCopied ); + total += lenCopied; + while ( total < length ) { + is->funcs->getData( fsmRun, is, total, runBuf->data+total, length-total, &lenCopied ); + total += lenCopied; + } + is->funcs->consumeData( is, length ); fsmRun->p = fsmRun->pe = fsmRun->scanBuf->data; |