[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#544018: Minimal fix (actually implement what the documentation says :) )



The manpage states "Lines starting with ‘#’ and empty lines are interpreted as comments."
So comments should not start in the middle of a word / line.

attached is a minimal patch.

(the freebsd patch also works and cleans a lot, but IMHO the (char)NULL should be patched separately and their pointer arithmetic is weird and unneeded)
diff --git a/ssmtp.c b/ssmtp.c
index af4d1e5..3ab3b4d 100644
--- a/ssmtp.c
+++ b/ssmtp.c
@@ -874,14 +874,12 @@ bool_t read_config()
 	while(fgets(buf, sizeof(buf), fp)) {
 		char *begin=buf;
 		char *rightside;
-		/* Make comments invisible */
-		if((p = strchr(buf, '#'))) {
-			*p = (char)NULL;
-		}
 
 		/* Ignore malformed lines and comments */
+		if(*strip_pre_ws(buf) == '#') continue;
 		if(strchr(buf, '=') == (char *)NULL) continue;
 
+
 		/* Parse out keywords */
 		p=firsttok(&begin, "= \t\n");
 		if(p){

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


Reply to: