From 2b4e22c3e4b28b08a0869b3a771ba54f0c615331 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Fri, 11 Jun 2021 12:27:59 -0400 Subject: Remove -t truncate flag It can't actually be used correctly: two updates in quick succession can truncate the output before it is read, causing files to be missed. --- archive.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'archive.c') diff --git a/archive.c b/archive.c index 3c5f12b..575bc56 100644 --- a/archive.c +++ b/archive.c @@ -82,7 +82,6 @@ static void createDirs(void) { int main(int argc, char *argv[]) { int exitStatus = 0; - bool truncate = false; const char *host = NULL; const char *port = "imaps"; @@ -96,7 +95,7 @@ int main(int argc, char *argv[]) { for ( int opt; - 0 < (opt = getopt(argc, argv, "A:C:H:S:T:a:h:im:p:qs:tu:vw:y:")); + 0 < (opt = getopt(argc, argv, "A:C:H:S:T:a:h:im:p:qs:u:vw:y:")); ) { switch (opt) { break; case 'A': concatIndexEntries = strtoul(optarg, NULL, 10); @@ -114,7 +113,6 @@ int main(int argc, char *argv[]) { break; case 'p': port = optarg; break; case 'q': quiet = true; exitStatus = EXIT_FAILURE; break; case 's': baseSubscribe = optarg; - break; case 't': truncate = true; break; case 'u': baseURL = optarg; break; case 'v': imapVerbose = true; break; case 'w': passPath = optarg; @@ -181,13 +179,7 @@ int main(int argc, char *argv[]) { for (; resp = respOk(imapResp(&imap)), resp.tag != login; respFree(resp)); respFree(resp); -examine: - if (truncate) { - int error = ftruncate(STDOUT_FILENO, 0); - if (error) warn("ftruncate"); - rewind(stdout); - } - +examine:; uint32_t uidNext = 0; uint32_t uidValidity = 0; enum Atom examine = atom("examine"); -- cgit 1.4.1