From 224d360bf25ee034b16fe7c12c9785eab9f5c25c Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 4 Mar 2021 23:02:43 -0500 Subject: [PATCH] gnu-mklog: handle ^L whitespace chars --- .bin/gnu-mklog | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.bin/gnu-mklog b/.bin/gnu-mklog index 52fd7ce..d24e0bf 100755 --- a/.bin/gnu-mklog +++ b/.bin/gnu-mklog @@ -93,8 +93,11 @@ def main(argv): new_log = new_log.replace(pfile.path, relpath) # Read the old ChangeLog file and strip spurious whitespace. + # Specify the whitespace to strip explciitly as we want to leave the + # \f (^L) characters alone. with open(log, encoding='utf-8') as fp: - old_log = '\n'.join(x.rstrip() for x in fp.read().strip().splitlines()) + old_log = '\n'.join(x.rstrip(' \t\r') + for x in fp.read().strip().split('\n')) # Now update the ChangeLog file with the new entry at top. with open(log, 'w', encoding='utf-8') as fp: -- 2.39.2