From f99a83f13f7606044e0a3d7d1f1e0bd3e6054850 Mon Sep 17 00:00:00 2001
From: Stephan Bosch <stephan@rename-it.nl>
Date: Fri, 31 Jul 2009 17:35:51 +0200
Subject: [PATCH] Fixed bug in the derivation of the binary path from the
 script path. A bare filename would yield a path relative to root.

---
 src/lib-sieve/sieve-script.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/lib-sieve/sieve-script.c b/src/lib-sieve/sieve-script.c
index 141f63aa8..05d175320 100644
--- a/src/lib-sieve/sieve-script.c
+++ b/src/lib-sieve/sieve-script.c
@@ -89,7 +89,11 @@ struct sieve_script *sieve_script_init
 		}
 
 		basename = _sieve_scriptfile_get_basename(filename);
-		binpath = t_strconcat(dirpath, "/", basename, ".svbin", NULL);
+
+		if ( *dirpath == '\0' )
+			binpath = t_strconcat(basename, ".svbin", NULL);
+		else
+			binpath = t_strconcat(dirpath, "/", basename, ".svbin", NULL);
 				
 		if ( name == NULL ) {
 			name = basename; 
-- 
GitLab