Work with unix line endings on display ansi

This commit is contained in:
Andrew Pamment 2018-01-15 14:21:53 +10:00
parent dd1d4d4eaa
commit 209c8b932c

View File

@ -296,14 +296,20 @@ void s_displayansi_pause(char *file, int pause) {
char c;
char ch;
int lines = 0;
char lastch = 0;
fptr = fopen(file, "r");
if (!fptr) {
return;
}
c = fgetc(fptr);
while (!feof(fptr) && c != 0x1a) {
if (c == '\n' && lastch != '\r') {
s_putchar('\r');
}
s_putchar(c);
lastch = c;
if (pause) {
if (c == '\n') {