diff -r dd898f214ed7 -r 52527e90ed80 maildir.c --- a/maildir.c Wed Apr 02 13:14:04 2014 +0500 +++ b/maildir.c Wed Apr 02 14:44:04 2014 +0500 @@ -101,7 +101,7 @@ SHA1Init(&ctx); while (( len = read(msg_fd, buf, sizeof(buf))) > 0) { SHA1Update(&ctx, (u_int8_t *)buf, len); - for (C = buf;len--; ++C) + for (C = buf; len--; ++C) if (*C == '\n') msg->nlines += 1; } @@ -176,6 +176,7 @@ int fd, r; *offset = 0; + *nlines = m->msgs_index[idx]->nlines; r = snprintf(buf, sizeof(buf), "cur/%s", m->msgs_index[idx]->u.fname); if ((u_int)r >= sizeof(buf)) { logit(LOG_WARNING, "path too long");