Re: allow comments and empty lines in spamd.alloweddomains

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: d-ra
Date: Tuesday, February 17, 2009 - 3:39 pm

On Tue, Feb 17, 2009 at 10:24:28PM +0100, Otto Moerbeek wrote:

OK, but it would be handy to allow comments. The attached patch honors
fgetln(3) habit not to return C style strings. But it does not detect
empty lines, i.e. lines with len==0.
--- grey.c.orig	Tue Feb 17 23:27:39 2009
+++ grey.c	Tue Feb 17 23:30:57 2009
@@ -321,6 +321,8 @@
 		while ((buf = fgetln(fp, &len))) {
 			if (buf[len-1] == '\n')
 				len--;
+			if ( len && (buf[0]=='#') )
+				continue;
 			if ((m = malloc(sizeof(struct mail_addr))) == NULL)
 				goto bad;
 			if ((len + 1) > sizeof(m->addr)) {
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
allow comments and empty lines in spamd.alloweddomains, Stephan A. Rickauer, (Tue Feb 17, 1:13 pm)
Re: allow comments and empty lines in spamd.alloweddomains, Stephan A. Rickauer, (Tue Feb 17, 3:02 pm)
Re: allow comments and empty lines in spamd.alloweddomains, d-ra, (Tue Feb 17, 3:39 pm)
Re: allow comments and empty lines in spamd.alloweddomains, patrick keshishian, (Tue Feb 17, 11:14 pm)
Re: allow comments and empty lines in spamd.alloweddomains, Stephan A. Rickauer, (Wed Feb 18, 1:44 am)