diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2019-08-16 15:18:32 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2019-08-16 15:18:32 +0300 |
commit | 4f28dd2d8ad1f112a203cb7aa5f2609a90b6418a (patch) | |
tree | 6432129e9bc0f36f4ef0b2b87e985fcda8f93c56 /capture.c | |
parent | d5bf414da37b54bba279cc32cf23065dd3f04045 (diff) | |
download | posixruncapture-4f28dd2d8ad1f112a203cb7aa5f2609a90b6418a.tar.gz posixruncapture-4f28dd2d8ad1f112a203cb7aa5f2609a90b6418a.tar.bz2 |
Upgrade runcap
Diffstat (limited to 'capture.c')
-rw-r--r-- | capture.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -30,7 +30,12 @@ line_monitor(const char *ptr, size_t sz, void *closure) { struct line_closure *lc = closure; - if (lc->len || ptr[sz-1] != '\n') { + if (sz == 0) { + if (lc->len) { + call_monitor(lc->cv, lc->str, lc->len); + lc->len = 0; + } + } else if (lc->len || ptr[sz-1] != '\n') { size_t newsz = lc->len + sz + 1; if (newsz > lc->size) { |