hopefully handle \r\n endings

This commit is contained in:
Bill Currie 2004-03-19 00:41:14 +00:00
parent 2b26072c8f
commit 9e6be1e029

View file

@ -672,7 +672,8 @@ LoadPortals (char *name)
line = Qgetline (f);
if (line && !strcmp (line, PORTALFILE "\n")) {
if (line && (!strcmp (line, PORTALFILE "\n")
|| !strcmp (line, PORTALFILE "\r\n"))) {
line = Qgetline (f);
if (!line || sscanf (line, "%i\n", &portalclusters) != 1)
Sys_Error ("LoadPortals: failed to read header");
@ -680,7 +681,8 @@ LoadPortals (char *name)
if (!line || sscanf (line, "%i\n", &numportals) != 1)
Sys_Error ("LoadPortals: failed to read header");
numrealleafs = portalclusters;
} else if ((line && !strcmp (line, PORTALFILE_AM "\n"))) {
} else if (line && (!strcmp (line, PORTALFILE_AM "\n")
|| !strcmp (line, PORTALFILE_AM "\r\n"))) {
line = Qgetline (f);
if (!line || sscanf (line, "%i\n", &portalclusters) != 1)
Sys_Error ("LoadPortals: failed to read header");