take care of \r*\n line endings

This commit is contained in:
Bill Currie 2001-11-26 23:23:29 +00:00
parent 67fde0c492
commit c4646b9685
2 changed files with 6 additions and 2 deletions

View file

@ -147,8 +147,10 @@ locs_load (const char *filename)
t2[0] = '\0';
// handle dos format lines (COM_FOpenFile is binary only)
// and unix is effectively binary only anyway
if (t2 > t1 && t2[-1] == '\r')
while (t2 > t1 && t2[-1] == '\r') {
t2[-1] = '\0';
t2--;
}
}
locs_add (loc, t1);
}

View file

@ -148,8 +148,10 @@ locs_load (const char *filename)
t2[0] = '\0';
// handle dos format lines (COM_FOpenFile is binary only)
// and unix is effectively binary only anyway
if (t2 > t1 && t2[-1] == '\r')
while (t2 > t1 && t2[-1] == '\r') {
t2[-1] = '\0';
t2--;
}
}
locs_add (loc, t1);
}