From 6eaad195a82bab663ebe934c1afbd279aef9ce22 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Wed, 6 Mar 2019 13:38:42 +0100 Subject: [PATCH] Fix padding after equal sign in makefiles Padding should be done only if RHS is not empty. Signed-off-by: Jan Lindemann --- scripts/process-text-files.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/process-text-files.py b/scripts/process-text-files.py index 96e6214..8209843 100644 --- a/scripts/process-text-files.py +++ b/scripts/process-text-files.py @@ -69,7 +69,9 @@ class Cmd(jwutils.Cmd): if right_align_match > 0: parts[1] = parts[1].rjust(right_align_match) if len(parts) > 2: - parts[2] = ' ' + parts[2].strip() + p2_stripped = parts[2].strip() + if len(p2_stripped) or len(parts) > 3: + parts[2] = ' ' + p2_stripped r += parts[0].rstrip().ljust(indent) + ''.join(parts[1:]) + '\n' assignments += 1 if min_assignments is not None and assignments < min_assignments: