summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a0f552b)
raw | patch | inline | side by side (parent: a0f552b)
author | Sebastian Harl <sh@tokkee.org> | |
Mon, 23 Aug 2010 17:02:06 +0000 (19:02 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Mon, 23 Aug 2010 17:07:22 +0000 (19:07 +0200) |
The tool is supposed to work line-based, so a) the newline character is
implicit and b) imho, does not belong to the string which is then further
processed.
Also, this allows '$' to match the end of a line when applying a regex to the
line, no matter if the REG_NEWLINE flag has been used when compiling the regex
or not.
implicit and b) imho, does not belong to the string which is then further
processed.
Also, this allows '$' to match the end of a line when applying a regex to the
line, no matter if the REG_NEWLINE flag has been used when compiling the regex
or not.
src/utils_tail.c | patch | blob | history |
diff --git a/src/utils_tail.c b/src/utils_tail.c
index 904a52122e7e40d4d6ebcc47788d218fe99888fa..5b7551d3a18f4925cb0403f454350373c8c7c6e8 100644 (file)
--- a/src/utils_tail.c
+++ b/src/utils_tail.c
while (42)
{
+ size_t len;
+
status = cu_tail_readline (obj, buf, buflen);
if (status != 0)
{
if (buf[0] == 0)
break;
+ len = strlen (buf);
+ while (len > 0) {
+ if (buf[len - 1] != '\n')
+ break;
+ buf[len - 1] = '\0';
+ }
+
status = callback (data, buf, buflen);
if (status != 0)
{