From 30631b0fc535d2d83944e2175379cd41d015e397 Mon Sep 17 00:00:00 2001 From: downtownallday Date: Sat, 25 Jun 2022 12:35:03 -0400 Subject: [PATCH] Fix undefined variable 'val' in tools/editconf.py (#2137) Merges #2137. --- tools/editconf.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/editconf.py b/tools/editconf.py index e80742e4..dc184966 100755 --- a/tools/editconf.py +++ b/tools/editconf.py @@ -136,9 +136,10 @@ while len(input_lines) > 0: # Put any settings we didn't see at the end of the file, # except settings being cleared. for i in range(len(settings)): - if (i not in found) and not (not val and erase_setting): + if i not in found: name, val = settings[i].split("=", 1) - buf += name + delimiter + val + "\n" + if not (not val and erase_setting): + buf += name + delimiter + val + "\n" if not testing: # Write out the new file.