From be573713a6673f7a617323b368f8e0c7f2fdd327 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Thu, 16 Feb 2023 22:43:33 +0600 Subject: [PATCH] config: Fix serial passthrough saving --- src/config.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/config.c b/src/config.c index 056a00887..2a8a32e4b 100644 --- a/src/config.c +++ b/src/config.c @@ -2472,11 +2472,12 @@ save_ports(void) (char *) com_device_get_internal_name(com_ports[c].device)); */ - if (com_ports[c].enabled) - if (serial_passthrough_enabled[c]) { - sprintf(temp, "serial%d_passthrough_enabled", c + 1); - ini_section_set_int(cat, temp, 1); - } + sprintf(temp, "serial%d_passthrough_enabled", c + 1); + if (serial_passthrough_enabled[c]) { + ini_section_set_int(cat, temp, 1); + } else { + ini_section_delete_var(cat, temp); + } } for (c = 0; c < PARALLEL_MAX; c++) {