From f69acc27558b8104cf17baa0799cb4447d6d6df8 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Wed, 25 Mar 2015 11:51:56 -0600 Subject: Fix some TAB alignment issues append_aligned_tabs_indent_with_tabs() was converting TABs to spaces to simplify calculation of line length, assuming the only TABs were at the beginning of the line, and hence were all exactly 8 characters wide. In some scenarios, TABs were also embedded within the line, which caused incorrect calculations. Solve this by explicitly evaluating TAB widths character by character, rather than taking shortcuts. Signed-off-by: Stephen Warren --- soc-to-kernel-pinctrl-driver.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'soc-to-kernel-pinctrl-driver.py') diff --git a/soc-to-kernel-pinctrl-driver.py b/soc-to-kernel-pinctrl-driver.py index f7743e0..46547b1 100755 --- a/soc-to-kernel-pinctrl-driver.py +++ b/soc-to-kernel-pinctrl-driver.py @@ -302,7 +302,7 @@ else: .drv_reg = -1, ''' -s = append_aligned_tabs_indent_with_tabs(s) +s = append_aligned_tabs_indent_with_tabs(s, 72) print(s) print('''\ @@ -372,7 +372,7 @@ s += '''\ .drvtype_bit = %(drvtype_bit_val)s ''' % globals() -s = append_aligned_tabs_indent_with_tabs(s) +s = append_aligned_tabs_indent_with_tabs(s, 72) print(s) print('''\ -- cgit v1.2.1