dovecot-2.1-pigeonhole: lib-sieve: made sure error locations nev...

pigeonhole at rename-it.nl pigeonhole at rename-it.nl
Mon Dec 12 01:26:31 EET 2011


details:   http://hg.rename-it.nl/dovecot-2.1-pigeonhole/rev/d56a318174db
changeset: 1573:d56a318174db
user:      Stephan Bosch <stephan at rename-it.nl>
date:      Mon Dec 12 00:25:47 2011 +0100
description:
lib-sieve: made sure error locations never report `line 0'.

diffstat:

 src/lib-sieve/sieve-error.c |  9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diffs (20 lines):

diff -r a224cdad4aa3 -r d56a318174db src/lib-sieve/sieve-error.c
--- a/src/lib-sieve/sieve-error.c	Mon Dec 12 00:23:04 2011 +0100
+++ b/src/lib-sieve/sieve-error.c	Mon Dec 12 00:25:47 2011 +0100
@@ -41,8 +41,15 @@
 
 	sname = ( script == NULL ? NULL : sieve_script_name(script) );
 
-	if ( sname == NULL || *sname == '\0' )
+	if ( sname == NULL || *sname == '\0' ) {
+		if ( source_line == 0 )
+			return NULL;
+
 		return t_strdup_printf("line %d", source_line);
+	}
+
+	if ( source_line == 0 )
+		return sname;
 
 	return t_strdup_printf("%s: line %d", sname, source_line);
 }


More information about the dovecot-cvs mailing list