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

pigeonhole at rename-it.nl pigeonhole at rename-it.nl
Sat Dec 17 16:19:22 EET 2011


details:   http://hg.rename-it.nl/dovecot-2.0-pigeonhole/rev/5bbd8d148b7d
changeset: 1549:5bbd8d148b7d
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 b2839569e943 -r 5bbd8d148b7d src/lib-sieve/sieve-error.c
--- a/src/lib-sieve/sieve-error.c	Sat Dec 17 15:11:40 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