чување ead2b570208b7df7c7ccc3cc6021c2fcad704a10
родитељ af9976b41e5b3169212f2cacb43501847c84bf29
Аутор: Страхиња Радић <contact@strahinja.org>
Датум: Thu, 4 Mar 2021 16:04:40 +0100
Limited msdos CR check to single character before eol
Signed-off-by: Страхиња Радић <contact@strahinja.org>
Diffstat:
измењених датотека: 1, додавања: 4(+), брисања: 5(-)
diff --git a/table.c b/table.c
@@ -489,7 +489,11 @@ main(int argc, char** argv)
eol = strchr((char*)line, '\n');
if (eol)
+ {
+ if (msdos && *line != '\n' && *(eol-1) == '\r')
+ *(eol-1) = 0;
*eol = 0;
+ }
if (!*line)
continue;
@@ -607,11 +611,6 @@ main(int argc, char** argv)
}
colno++;
}
- else if (uch == '\r' && msdos)
- {
- pline++;
- colno++;
- }
else if (uch == '\t' && expand_tabs)
{
while (within_column(column_start))