diff options
Diffstat (limited to 'usr.bin/indent/io.c')
-rw-r--r-- | usr.bin/indent/io.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/usr.bin/indent/io.c b/usr.bin/indent/io.c index 3a2eaf4..45eb6c2 100644 --- a/usr.bin/indent/io.c +++ b/usr.bin/indent/io.c @@ -472,11 +472,13 @@ pad_output(int current, int target) if (current >= target) return (current); /* line is already long enough */ curr = current; - while ((tcur = ((curr - 1) & tabmask) + tabsize + 1) <= target) { - putc('\t', output); - curr = tcur; - } - while (curr++ < target) + if (use_tabs) { + while ((tcur = ((curr - 1) & tabmask) + tabsize + 1) <= target) { + putc('\t', output); + curr = tcur; + } + } + while (curr++ < target) putc(' ', output); /* pad with final blanks */ } return (target); |