summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2005-01-05 16:23:03 +0000
committerLennart Poettering <lennart@poettering.net>2005-01-05 16:23:03 +0000
commita74bb12c9f72e2fd806b64dda79d4538d86e762c (patch)
tree39609c87a74ece0a908e72a3f10be64a4f8ca1f8
parent5e05228a9dc302e303dc70609418e8450b5225bf (diff)
merge patch by peter griessHEADmaster
git-svn-id: file:///home/lennart/svn/public/libnewmail/trunk@42 2d4e79f2-dfba-0310-a9f4-9628e67fcdf4
-rw-r--r--src/unix.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/unix.c b/src/unix.c
index 181ff7a..b9e652d 100644
--- a/src/unix.c
+++ b/src/unix.c
@@ -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);