mblaze

Unix utilities to deal with Maildir - my mirror
git clone https://pi.duncano.de/git/mblaze.git
Log | Files | Refs | README | COPYING

commit 472a74b75b598e38856d8f8ad9e71f355b7538c6
parent 3167a7a2d35173414fa1b333db4908ac140c1c4d
Author: Christian Neukirchen <chneukirchen@gmail.com>
Date:   Mon,  5 Sep 2016 14:20:55 +0200

use getdelim instead of getline

Avoids weird macros to build on FreeBSD.

Diffstat:
mdeliver.c | 4++--
mexport.c | 2+-
mmime.c | 2+-
mseq.c | 2+-
4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/mdeliver.c b/mdeliver.c @@ -60,7 +60,7 @@ deliver(FILE *infile) // skip to first "From " line while (1) { errno = 0; - ssize_t rd = getline(&line, &linelen, infile); + ssize_t rd = getdelim(&line, &linelen, '\n', infile); if (rd == -1) { if (errno == 0) // invalid mbox file @@ -98,7 +98,7 @@ tryagain: int is_old = 0; while (1) { errno = 0; - ssize_t rd = getline(&line, &linelen, infile); + ssize_t rd = getdelim(&line, &linelen, '\n', infile); if (rd == -1) { if (errno != 0) return -1; diff --git a/mexport.c b/mexport.c @@ -62,7 +62,7 @@ export(char *file) while (1) { errno = 0; - ssize_t rd = getline(&line, &linelen, infile); + ssize_t rd = getdelim(&line, &linelen, '\n', infile); if (rd == -1) { if (errno == 0) break; diff --git a/mmime.c b/mmime.c @@ -273,7 +273,7 @@ gen_build() int intext = 0; while (1) { - int read = getline(&line, &linelen, stdin); + int read = getdelim(&line, &linelen, '\n', stdin); if (read == -1) { if (feof(stdin)) break; diff --git a/mseq.c b/mseq.c @@ -205,7 +205,7 @@ stdinmode() outfile = stdout; } - while ((rd = getline(&line, &linelen, stdin)) != -1) { + while ((rd = getdelim(&line, &linelen, '\n', stdin)) != -1) { if (line[rd-1] == '\n') line[rd-1] = 0;