From bd3a2b1bb5765fb3bc7da130264883637a486511 Mon Sep 17 00:00:00 2001
From: Scruel Tao <scruelt@hotmail.com>
Date: Tue, 27 Feb 2024 12:40:52 +0800
Subject: [PATCH] Prevent leaving blank lines in config file after cleared
 keys.

---
 acme.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/acme.sh b/acme.sh
index 9c5b1481..999c4f8d 100755
--- a/acme.sh
+++ b/acme.sh
@@ -2351,7 +2351,7 @@ _clear_conf() {
   _sdkey="$2"
   if [ "$_c_c_f" ]; then
     _conf_data="$(cat "$_c_c_f")"
-    echo "$_conf_data" | sed "s/^$_sdkey *=.*$//" >"$_c_c_f"
+    echo "$_conf_data" | sed "/^$_sdkey *=.*$/d" >"$_c_c_f"
   else
     _err "config file is empty, can not clear"
   fi