Commit 2718f309 authored by Bruce Momjian's avatar Bruce Momjian

Fix for entab.

parent 268b8be8
...@@ -113,10 +113,12 @@ char **argv; ...@@ -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? /*
Is the next character going to be a tab?
Needed to do tab replacement in current spot if Needed to do tab replacement in current spot if
next char is going to be a tab, ignoring next char is going to be a tab, ignoring
min_spaces */ min_spaces
*/
nxt_spaces = 0; nxt_spaces = 0;
while (1) while (1)
{ {
...@@ -133,9 +135,11 @@ char **argv; ...@@ -133,9 +135,11 @@ char **argv;
break; break;
} }
} }
if ((prv_spaces >= min_spaces || nxt_spaces == tab_size) && if (quote_char == ' ')
quote_char == ' ' && {
del_tabs == FALSE ) if ((prv_spaces >= min_spaces ||
nxt_spaces == tab_size) &&
del_tabs == FALSE)
{ {
*(dst++) = '\t'; *(dst++) = '\t';
prv_spaces = 0; prv_spaces = 0;
...@@ -147,6 +151,7 @@ char **argv; ...@@ -147,6 +151,7 @@ char **argv;
} }
} }
} }
}
else else
{ {
for (; prv_spaces > 0; prv_spaces--) for (; prv_spaces > 0; prv_spaces--)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment