Work with unix line endings on display ansi
This commit is contained in:
parent
dd1d4d4eaa
commit
209c8b932c
@ -296,6 +296,7 @@ void s_displayansi_pause(char *file, int pause) {
|
||||
char c;
|
||||
char ch;
|
||||
int lines = 0;
|
||||
char lastch = 0;
|
||||
|
||||
fptr = fopen(file, "r");
|
||||
if (!fptr) {
|
||||
@ -303,8 +304,13 @@ void s_displayansi_pause(char *file, int pause) {
|
||||
}
|
||||
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') {
|
||||
lines++;
|
||||
|
Reference in New Issue
Block a user