From ddf04b9c613c82e6f5ddaad1258347baa265ee8c Mon Sep 17 00:00:00 2001 From: Demi Marie Obenour Date: Tue, 26 Jul 2022 13:39:43 -0400 Subject: [PATCH] Use simpler check to allow spaces in file names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 0x20 (space) should be allowed. Explicitly check for the interval containing only 0x20, instead of using the fact that i will be 0x21 at the next loop iteration. Suggested-by: Marek Marczykowski-Górecki --- gentbl.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gentbl.py b/gentbl.py index 0c8298d8..7571025c 100755 --- a/gentbl.py +++ b/gentbl.py @@ -17,7 +17,9 @@ def print_interval(interval, last_cat): if cat == last_cat: interval[1] = i else: - if last_cat[0] in ('C', 'Z') and i != 0x21: + # Allow the interval consisting only of 0x20, to allow spaces in + # file names + if last_cat[0] in ('C', 'Z') and interval != [0x20, 0x20]: print_interval(interval, last_cat) interval = [i, i] print_interval(interval, last_cat)