witz.patch
uppsvn/uppsrc/Skylark/Preprocess.cpp (working copy) | ||
---|---|---|
42 | 42 |
} |
43 | 43 |
else |
44 | 44 |
r << line; |
45 |
r << "\r\n";
|
|
45 |
r << "\n";
|
|
46 | 46 |
} |
47 | 47 |
return r; |
48 | 48 |
} |
... | ... | |
65 | 65 |
def[ti] << p.GetPtr(); |
66 | 66 |
} |
67 | 67 |
else |
68 |
def[ti] << line << "\r\n";
|
|
68 |
def[ti] << line << "\n";
|
|
69 | 69 |
} |
70 | 70 |
return def; |
71 | 71 |
} |
72 | 72 | |
73 |
int CharFilterIsCrLf(int c) |
|
74 |
{ |
|
75 |
return c == '\r' || c == '\n' ? c : 0; |
|
76 |
} |
|
77 | ||
78 | 73 |
String ReplaceVars(const String& src, const VectorMap<String, String>& def, int chr, Index<String>& expanded) |
79 | 74 |
{ |
80 | 75 |
String r; |
... | ... | |
129 | 124 |
} |
130 | 125 |
VectorMap<String, String> def = GetTemplateDefs(file, lang); |
131 | 126 |
String r = ReplaceVars(def.Get(id, Null), def, '#'); |
132 |
return Join(Split(r, CharFilterIsCrLf), "\r\n");
|
|
127 |
return Join(Split(r, "\n", false), "\r\n");
|
|
133 | 128 |
} |
134 | 129 | |
135 | 130 |
}; |