File 0001-add-a-safety-n-before-the-end-script-comment.patch of Package openscap.8520

From 42d973638308a67c22127c9a4daace80e7404511 Mon Sep 17 00:00:00 2001
From: Marcus Meissner <meissner@suse.de>
Date: Fri, 3 Aug 2018 16:41:19 +0200
Subject: [PATCH] add a safety \n before the end script comment.

This helps if someone uses <fix></fix> without a terminating newline
---
 src/XCCDF_POLICY/xccdf_policy_remediate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/XCCDF_POLICY/xccdf_policy_remediate.c b/src/XCCDF_POLICY/xccdf_policy_remediate.c
index 7841fd648..c757c9461 100644
--- a/src/XCCDF_POLICY/xccdf_policy_remediate.c
+++ b/src/XCCDF_POLICY/xccdf_policy_remediate.c
@@ -565,7 +565,7 @@ static int _write_fix_header_to_fd(const char *sys, int output_fd, struct xccdf_
 static int _write_fix_footer_to_fd(const char *sys, int output_fd, struct xccdf_rule *rule)
 {
 	if (oscap_streq(sys, "") || oscap_streq(sys, "urn:xccdf:fix:script:sh") || oscap_streq(sys, "urn:xccdf:fix:commands")) {
-		char *fix_footer = oscap_sprintf("# END fix for '%s'\n\n", xccdf_rule_get_id(rule));
+		char *fix_footer = oscap_sprintf("\n# END fix for '%s'\n\n", xccdf_rule_get_id(rule));
 		return _write_text_to_fd_and_free(output_fd, fix_footer);
 	} else {
 		return 0;
-- 
2.13.7
openSUSE Build Service is sponsored by