From 6bc8bc5fefd1fdc3a09e8b94010b37a0f51401ff Mon Sep 17 00:00:00 2001
From: Stephan Bosch <stephan.bosch@open-xchange.com>
Date: Thu, 19 Sep 2024 21:04:59 +0200
Subject: [PATCH] lib-sieve-tool: sieve-tool - Remove name argument from
 sieve_tool_script_compile()

---
 src/lib-sieve-tool/sieve-tool.c | 5 ++---
 src/lib-sieve-tool/sieve-tool.h | 3 +--
 src/sieve-tools/sieve-filter.c  | 2 +-
 src/sieve-tools/sieve-test.c    | 4 ++--
 src/sieve-tools/sievec.c        | 4 ++--
 5 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/src/lib-sieve-tool/sieve-tool.c b/src/lib-sieve-tool/sieve-tool.c
index bd5a6a4e8..be10d52dd 100644
--- a/src/lib-sieve-tool/sieve-tool.c
+++ b/src/lib-sieve-tool/sieve-tool.c
@@ -578,8 +578,7 @@ struct ostream *sieve_tool_open_output_stream(const char *filename)
  */
 
 struct sieve_binary *
-sieve_tool_script_compile(struct sieve_tool *tool, const char *location,
-			  const char *name)
+sieve_tool_script_compile(struct sieve_tool *tool, const char *location)
 {
 	struct sieve_instance *svinst = tool->svinst;
 	struct sieve_error_handler *ehandler;
@@ -589,7 +588,7 @@ sieve_tool_script_compile(struct sieve_tool *tool, const char *location,
 	sieve_error_handler_accept_infolog(ehandler, TRUE);
 	sieve_error_handler_accept_debuglog(ehandler, svinst->debug);
 
-	if (sieve_compile(svinst, location, name, ehandler, 0, &sbin, NULL) < 0)
+	if (sieve_compile(svinst, location, NULL, ehandler, 0, &sbin, NULL) < 0)
 		i_fatal("failed to compile sieve script '%s'", location);
 	i_assert(sbin != NULL);
 
diff --git a/src/lib-sieve-tool/sieve-tool.h b/src/lib-sieve-tool/sieve-tool.h
index e973a9e72..8c506b2ec 100644
--- a/src/lib-sieve-tool/sieve-tool.h
+++ b/src/lib-sieve-tool/sieve-tool.h
@@ -85,8 +85,7 @@ struct ostream *sieve_tool_open_output_stream(const char *filename);
  */
 
 struct sieve_binary *
-sieve_tool_script_compile(struct sieve_tool *tool, const char *location,
-			  const char *name);
+sieve_tool_script_compile(struct sieve_tool *tool, const char *location);
 struct sieve_binary *
 sieve_tool_script_open(struct sieve_tool *tool, const char *location);
 void sieve_tool_dump_binary_to(struct sieve_binary *sbin,
diff --git a/src/sieve-tools/sieve-filter.c b/src/sieve-tools/sieve-filter.c
index df5f200cf..0dacacb1c 100644
--- a/src/sieve-tools/sieve-filter.c
+++ b/src/sieve-tools/sieve-filter.c
@@ -525,7 +525,7 @@ int main(int argc, char **argv)
 
 	/* Compile main sieve script */
 	if (force_compile) {
-		main_sbin = sieve_tool_script_compile(sieve_tool, scriptfile, NULL);
+		main_sbin = sieve_tool_script_compile(sieve_tool, scriptfile);
 		if (main_sbin != NULL)
 			(void)sieve_save(main_sbin, TRUE, NULL);
 	} else {
diff --git a/src/sieve-tools/sieve-test.c b/src/sieve-tools/sieve-test.c
index 19ed53b3e..b2cc351b5 100644
--- a/src/sieve-tools/sieve-test.c
+++ b/src/sieve-tools/sieve-test.c
@@ -296,7 +296,7 @@ int main(int argc, char **argv)
 
 	/* Compile main sieve script */
 	if (force_compile) {
-		main_sbin = sieve_tool_script_compile(sieve_tool, scriptfile, NULL);
+		main_sbin = sieve_tool_script_compile(sieve_tool, scriptfile);
 		if (main_sbin != NULL)
 			(void)sieve_save(main_sbin, TRUE, NULL);
 	} else {
@@ -415,7 +415,7 @@ int main(int argc, char **argv)
 				/* Compile sieve script */
 				if (force_compile) {
 					sbin = sieve_tool_script_compile(
-						sieve_tool, sfiles[i], sfiles[i]);
+						sieve_tool, sfiles[i]);
 					if (sbin != NULL)
 						(void)sieve_save(sbin, FALSE, NULL);
 				} else {
diff --git a/src/sieve-tools/sievec.c b/src/sieve-tools/sievec.c
index 91d2ecc2f..01afa32b6 100644
--- a/src/sieve-tools/sievec.c
+++ b/src/sieve-tools/sievec.c
@@ -122,7 +122,7 @@ int main(int argc, char **argv)
 				else
 					file = t_strconcat(scriptfile, "/", dp->d_name, NULL);
 
-				sbin = sieve_tool_script_compile(sieve_tool, file, NULL);
+				sbin = sieve_tool_script_compile(sieve_tool, file);
 
 				if (sbin != NULL) {
 					sieve_save(sbin, TRUE, NULL);
@@ -139,7 +139,7 @@ int main(int argc, char **argv)
 
 		   NOTE: For consistency, stat errors are handled here as well
 		 */
-		sbin = sieve_tool_script_compile(sieve_tool, scriptfile, NULL);
+		sbin = sieve_tool_script_compile(sieve_tool, scriptfile);
 		if (sbin != NULL) {
 			if (dump)
 				sieve_tool_dump_binary_to(sbin, outfile, FALSE);
-- 
GitLab