/* Try to read from the filehandle. If that succeeds, everything appears to
* be fine and we can return. */
+ clearerr (obj->fh);
if (fgets (buf, buflen, obj->fh) != NULL)
{
buf[buflen - 1] = 0;
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';
+ len--;
+ }
+
status = callback (data, buf, buflen);
if (status != 0)
{