16 |
|
{ |
17 |
|
string line; |
18 |
|
getline(fin, line); |
19 |
+ |
|
20 |
+ |
if (line[line.length() - 1] == '\r') |
21 |
+ |
{ |
22 |
+ |
line.erase(line.length() - 1); |
23 |
+ |
linux = true; |
24 |
+ |
} |
25 |
|
|
26 |
|
if (line.find("MapName=") == 0) |
27 |
|
{ |
47 |
|
|
48 |
|
if (debug) |
49 |
|
{ |
50 |
< |
cerr << "maps = {\n"; |
50 |
> |
cerr << "linux = " << (linux ? "true" : "false") << "\nmaps = {\n"; |
51 |
|
|
52 |
|
for (unsigned index = 0; index < maps.size(); index++) |
53 |
|
{ |
83 |
|
|
84 |
|
if (line == "MapName=") |
85 |
|
{ |
86 |
< |
fout << "MapName=" << maps[0] << (text.good() ? "\n" : ""); |
86 |
> |
fout << "MapName=" << maps[0] << (text.good() ? (linux ? "\r\n" : |
87 |
> |
"\n") : ""); |
88 |
|
} |
89 |
|
else if (line == "MapName00=") |
90 |
|
{ |
94 |
|
sprintf(number, "%02u", index); |
95 |
|
|
96 |
|
fout << "MapName" << number << "=" << maps[index] << (index + 1 |
97 |
< |
< maps.size() || text.good() ? "\n" : ""); |
97 |
> |
< maps.size() || text.good() ? (linux ? "\r\n" : "\n") : "" |
98 |
> |
); |
99 |
|
|
100 |
|
delete [] number; |
101 |
|
} |
102 |
|
} |
103 |
|
else |
104 |
|
{ |
105 |
< |
fout << line << (text.good() ? "\n" : ""); |
105 |
> |
fout << line << (text.good() ? (linux ? "\r\n" : "\n") : ""); |
106 |
|
} |
107 |
|
} |
108 |
|
while (text.good()); |