diff options
author | Lennart Poettering <lennart@poettering.net> | 2005-01-05 16:23:03 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2005-01-05 16:23:03 +0000 |
commit | a74bb12c9f72e2fd806b64dda79d4538d86e762c (patch) | |
tree | 39609c87a74ece0a908e72a3f10be64a4f8ca1f8 | |
parent | 5e05228a9dc302e303dc70609418e8450b5225bf (diff) |
git-svn-id: file:///home/lennart/svn/public/libnewmail/trunk@42 2d4e79f2-dfba-0310-a9f4-9628e67fcdf4
-rw-r--r-- | src/unix.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -75,6 +75,7 @@ static int _query(struct nm_spool *s, enum nm_query query, struct nm_status *sta while (!feof(f)) { static char ln[128]; + char *eol; if (!fgets(ln, sizeof(ln), f)) break; @@ -88,7 +89,15 @@ static int _query(struct nm_spool *s, enum nm_query query, struct nm_status *sta old++; hdr = 0; } - } + + /* Position the cursor at the next newline */ + do { + if (eol = strchr(ln, '\n')) { + fseek(f, -1 * strlen(eol + 1), SEEK_CUR); + break; + } + } while(fgets(ln, sizeof(ln), f)); + } fclose(f); |