PATCH: ekg

Jan Kanty Palus atler w o2.pl
Wto, 10 Sie 2004, 15:43:17 CEST


W zalaczniku latka poprawiajaca sprawdzanie poczty w ekg.
-------------- następna część ---------
--- ekg-1.5/src/mail.c.orig	2003-05-26 13:14:44.000000000 +0200
+++ ekg-1.5/src/mail.c	2004-08-10 15:24:34.726595040 +0200
@@ -1,4 +1,4 @@
-/* $Id: mail.c,v 1.51 2003/05/26 11:14:44 szalik Exp $ */
+/* $Id: mail.c,v 1.53 2004/08/10 13:13:07 szalik Exp $ */
 
 /*
  *  (C) Copyright 2001-2003 Piotr Domagalski <szalik w szalik.net>
@@ -110,8 +110,10 @@
 	if (new_count == mail_count)
 		return 0;
 
-	last_mail_count = mail_count;
-	mail_count = new_count;
+	if (!more) {
+		last_mail_count = mail_count;
+		mail_count = new_count;
+	}
 
 	if (!more && mail_count && mail_count > last_mail_count) {
 		if (config_check_mail & 4) {
@@ -455,29 +457,6 @@
 	check_mail_free();
 	memset(&foo, 0, sizeof(foo));
 
-	if (config_check_mail_folders) {
-		char **f = NULL;
-		int i;
-		
-		f = array_make(config_check_mail_folders, ", ", 0, 1, 1);
-
-		for (i = 0; f[i]; i++) {
-			if (f[i][0] != '/') {
-				char *buf = saprintf("%s/%s", home_dir, f[i]);
-				xfree(f[i]);
-				f[i] = buf;
-			}
-
-			foo.fhash = ekg_hash(f[i]);
-			foo.fname = f[i];
-			foo.check = 1;
-
-			list_add(&mail_folders, &foo, sizeof(foo));
-		}
-
-		xfree(f);
-	}
-
 	if (config_check_mail & 1) {
 		char *inbox = xstrdup(getenv("MAIL"));
 
@@ -506,6 +485,29 @@
 			list_add(&mail_folders, &foo, sizeof(foo));
 		}
 	}
+
+	if (config_check_mail_folders) {
+		char **f = NULL;
+		int i;
+		
+		f = array_make(config_check_mail_folders, ", ", 0, 1, 1);
+
+		for (i = 0; f[i]; i++) {
+			if (f[i][0] != '/') {
+				char *buf = saprintf("%s/%s", home_dir, f[i]);
+				xfree(f[i]);
+				f[i] = buf;
+			}
+
+			foo.fhash = ekg_hash(f[i]);
+			foo.fname = f[i];
+			foo.check = 1;
+
+			list_add(&mail_folders, &foo, sizeof(foo));
+		}
+
+		xfree(f);
+	}
 }
 
 /*


Więcej informacji o liście dyskusyjnej pld-devel-pl