diff options
author | Sunil Nimmagadda <sunil@nimmagadda.net> | 2014-04-02 14:43:34 +0500 |
---|---|---|
committer | Sunil Nimmagadda <sunil@nimmagadda.net> | 2014-04-02 14:43:34 +0500 |
commit | 82879323268fdd0d2eb08b5fd4f84407543466d9 (patch) | |
tree | 6f521090ae2fc3a9b977121f1c50021679713fc6 | |
parent | ed034f8989e711a99be36d0f148d8e65ad5d0c88 (diff) |
Return correct nlines for RETR in maildir handling.
-rw-r--r-- | maildir.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -101,7 +101,7 @@ init(struct mdrop *m, size_t *nmsgs, size_t *sz) 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 @@ retr(struct mdrop *m, unsigned int idx, size_t *nlines, size_t *offset) 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"); |