mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-27 00:06:16 +02:00
* Escape ASCII characters < 32 to Unicode FFFD (REPLACEMENT CHARACTER)
so that we don't produce un-wellformed XML.
This commit is contained in:
parent
f450c8ea2f
commit
c680f835c9
1 changed files with 2 additions and 1 deletions
|
@ -117,10 +117,11 @@ void Decoder::finishLine()
|
|||
if (priority != 1) cout << " priority='" << priority << "'";
|
||||
cout << ">";
|
||||
|
||||
for (int i = 0; i < line.size(); i++) {
|
||||
for (unsigned int i = 0; i < line.size(); i++) {
|
||||
|
||||
if (line[i] == '<') cout << "<";
|
||||
else if (line[i] == '&') cout << "&";
|
||||
else if (line[i] < 32 && line[i] != 9) cout << "�";
|
||||
else if (i + sz + 33 < line.size() &&
|
||||
string(line, i, sz) == storeDir &&
|
||||
line[i + sz + 32] == '-')
|
||||
|
|
Loading…
Reference in a new issue