aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runcap.c7
-rw-r--r--t/Makefile.am1
-rw-r--r--t/linemon02.at23
-rw-r--r--t/testsuite.at1
4 files changed, 32 insertions, 0 deletions
diff --git a/runcap.c b/runcap.c
index 6790dc4..5a09e55 100644
--- a/runcap.c
+++ b/runcap.c
@@ -143,6 +143,13 @@ stream_capture_get(struct stream_capture *cap, int *feof)
return -1;
}
if (rc == 0) {
+ if (cap->sc_linemon && cap->sc_level > cap->sc_cur) {
+ cap->sc_linemon(cap->sc_base + cap->sc_cur,
+ cap->sc_level - cap->sc_cur,
+ cap->sc_monarg);
+ cap->sc_cur = cap->sc_level;
+ cap->sc_nlines++;
+ }
*feof = 1;
return 0;
} else
diff --git a/t/Makefile.am b/t/Makefile.am
index b41aa20..22786c0 100644
--- a/t/Makefile.am
+++ b/t/Makefile.am
@@ -49,6 +49,7 @@ TESTSUITE_AT = \
pipe.at\
linemon00.at\
linemon01.at\
+ linemon02.at\
seek00.at\
seek01.at
# Add more files here
diff --git a/t/linemon02.at b/t/linemon02.at
new file mode 100644
index 0000000..87ff0ea
--- /dev/null
+++ b/t/linemon02.at
@@ -0,0 +1,23 @@
+AT_SETUP([line monitor, no trailing newline])
+AT_KEYWORDS([linemon linemon02.at])
+AT_CHECK([rt -m -- genout -l 31 $INPUT
+],
+[0],
+[stdout: CHAPTER I. Down the Rabbit-Holeres=0
+exit code: 0
+stdout: 1 lines, 31 bytes
+stderr: 0 lines, 0 bytes
+])
+
+AT_CHECK([rt -m -- genout -l 102 $INPUT
+],
+[0],
+[stdout: CHAPTER I. Down the Rabbit-Hole
+stdout:
+stdout: Alice was beginning to get very tired of sitting by her sister on theres=0
+exit code: 0
+stdout: 3 lines, 102 bytes
+stderr: 0 lines, 0 bytes
+])
+AT_CLEANUP
+
diff --git a/t/testsuite.at b/t/testsuite.at
index cdcec12..0c93340 100644
--- a/t/testsuite.at
+++ b/t/testsuite.at
@@ -25,6 +25,7 @@ m4_include([stdin.at])
m4_include([pipe.at])
m4_include([linemon00.at])
m4_include([linemon01.at])
+m4_include([linemon02.at])
m4_include([seek00.at])
m4_include([seek01.at])

Return to:

Send suggestions and report system problems to the System administrator.