Fix for entab.

This commit is contained in:
Bruce Momjian 1997-09-06 01:37:01 +00:00
parent 268b8be814
commit 2718f3097f
1 changed files with 19 additions and 14 deletions

View File

@ -113,10 +113,12 @@ char **argv;
if (col_in_tab == tab_size) if (col_in_tab == tab_size)
{ {
/* Is the next character going to be a tab? /*
Needed to do tab replacement in current spot if Is the next character going to be a tab?
next char is going to be a tab, ignoring Needed to do tab replacement in current spot if
min_spaces */ next char is going to be a tab, ignoring
min_spaces
*/
nxt_spaces = 0; nxt_spaces = 0;
while (1) while (1)
{ {
@ -133,17 +135,20 @@ char **argv;
break; break;
} }
} }
if ((prv_spaces >= min_spaces || nxt_spaces == tab_size) && if (quote_char == ' ')
quote_char == ' ' &&
del_tabs == FALSE )
{ {
*(dst++) = '\t'; if ((prv_spaces >= min_spaces ||
prv_spaces = 0; nxt_spaces == tab_size) &&
} del_tabs == FALSE)
else {
{ *(dst++) = '\t';
for (; prv_spaces > 0; prv_spaces--) prv_spaces = 0;
*(dst++) = ' '; }
else
{
for (; prv_spaces > 0; prv_spaces--)
*(dst++) = ' ';
}
} }
} }
} }