summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@complang.org>2013-01-27 14:31:14 -0500
committerAdrian Thurston <thurston@complang.org>2013-01-27 14:31:14 -0500
commitd2d780618386860d7fb6260579ca705f8bb902e8 (patch)
tree7f5d18120286801a08734d614c3e5c12461e6bcf
parent73d0bdf8c771116da360cf8cf4b075f4d8431db6 (diff)
downloadcolm-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.c7
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;