[Pkg-wmaker-commits] [wmbiff] 56/77: move msgs=-1 assignment on failure to the common openMailbox()

Doug Torrance dtorrance-guest at moszumanska.debian.org
Thu Aug 20 03:01:14 UTC 2015


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to tag wmbiff_0_4_0
in repository wmbiff.

commit 3b35897b7bdd0fe01263069cd3897a503669ce0b
Author: bluehal <bluehal>
Date:   Sat Apr 20 09:12:35 2002 +0000

    move msgs=-1 assignment on failure to the common openMailbox()
---
 wmbiff/LicqClient.c | 18 ++++++++----------
 wmbiff/mboxClient.c | 15 ++++++++-------
 2 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/wmbiff/LicqClient.c b/wmbiff/LicqClient.c
index ad4ea5e..722c51d 100644
--- a/wmbiff/LicqClient.c
+++ b/wmbiff/LicqClient.c
@@ -1,10 +1,10 @@
-/* $Id: LicqClient.c,v 1.9 2002/04/20 07:54:06 bluehal Exp $ */
+/* $Id: LicqClient.c,v 1.10 2002/04/20 09:12:35 bluehal Exp $ */
 /* Author : Yong-iL Joh ( tolkien at mizi.com )
    Modified: Jorge Garc�a ( Jorge.Garcia at uv.es )
  * 
  * LICQ checker.
  *
- * Last Updated : $Date: 2002/04/20 07:54:06 $
+ * Last Updated : $Date: 2002/04/20 09:12:35 $
  *
  */
 
@@ -30,12 +30,9 @@ int licqCheckHistory(Pop3 pc)
 		char buf[1024];
 		int count_status = 0;
 
-		/* file was changed OR initially read */
-		DM(pc, DEBUG_INFO, "  was changed,"
-		   " TIME: new %lu SIZE: new %lu\n",
-		   PCM.mtime, (unsigned long) PCM.size);
-
 		F = openMailbox(pc, pc->path);
+		if (F == NULL)
+			return -1;
 		/* count message */
 		while (fgets(buf, BUF_SIZE, F)) {
 			if ((buf[0] == '[') || (buf[0] == '-')) {	/* new, or old licq */
@@ -49,9 +46,10 @@ int licqCheckHistory(Pop3 pc)
 		DM(pc, DEBUG_INFO, "from: %d status: %d\n", pc->TotalMsgs,
 		   pc->UnreadMsgs);
 
-		/* Not clear that resetting the mtime is useful, as mutt
-		   is not involved.  Unfortunately, I can't tell whether
-		   this cut-and-pasted code is useful */
+		/* Not clear that resetting the mtime is useful, as
+		   mutt is not involved.  Unfortunately, I
+		   (nspring/blueHal) can't tell whether this
+		   cut-and-pasted code is needed */
 		ut.modtime = PCM.mtime;
 		utime(pc->path, &ut);
 	}
diff --git a/wmbiff/mboxClient.c b/wmbiff/mboxClient.c
index ffaaab6..35c4ada 100644
--- a/wmbiff/mboxClient.c
+++ b/wmbiff/mboxClient.c
@@ -1,11 +1,12 @@
-/* $Id: mboxClient.c,v 1.11 2002/04/20 07:54:06 bluehal Exp $ */
+/* $Id: mboxClient.c,v 1.12 2002/04/20 09:12:35 bluehal Exp $ */
 /* Author:		Yong-iL Joh <tolkien at mizi.com>
    Modified:	Jorge Garc�a <Jorge.Garcia at uv.es>
    			 	Rob Funk <rfunk at funknet.net>
+   			 	Neil Spring <nspring at cs.washington.edu>
  * 
  * MBOX checker.
  *
- * Last Updated : Thu Apr 26 03:09:40 CEST 2001
+ * Last Updated : $Date: 2002/04/20 09:12:35 $
  *
  */
 
@@ -28,6 +29,8 @@ FILE *openMailbox(Pop3 pc, const char *mbox_filename)
 	if ((mailbox = fopen(mbox_filename, "r")) == NULL) {
 		DM(pc, DEBUG_ERROR, "Error opening mailbox '%s': %s\n",
 		   mbox_filename, strerror(errno));
+		pc->TotalMsgs = -1;
+		pc->UnreadMsgs = -1;
 	}
 	return (mailbox);
 }
@@ -35,18 +38,16 @@ FILE *openMailbox(Pop3 pc, const char *mbox_filename)
 /* count the messages in a mailbox */
 static void countMessages(Pop3 pc, const char *mbox_filename)
 {
-	FILE *F = openMailbox(pc, mbox_filename);
+	FILE *F;
 	char buf[BUF_SIZE];
 	int is_header = 0;
 	int next_from_is_start_of_header = 1;
 	int count_from = 0, count_status = 0;
 	int len_from = strlen(FROM_STR), len_status = strlen(STATUS_STR);
 
-	if (F == NULL) {
-		pc->TotalMsgs = -1;
-		pc->UnreadMsgs = -1;
+	F = openMailbox(pc, mbox_filename);
+	if (F == NULL)
 		return;
-	}
 
 	/* count message */
 	while (fgets(buf, BUF_SIZE, F)) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmbiff.git



More information about the Pkg-wmaker-commits mailing list