Add single and double quotes to escaped characters in XML output

We already escape '<', '>', and '&'. This adds the remaining two special
entities in XML: '\'' and '\"'.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2012-08-27 09:38:23 -07:00
parent b693bb3fb9
commit 162b69828a

View file

@ -97,6 +97,12 @@ static void quote(FILE *f, const char *text)
case '&':
escape = "&amp;";
break;
case '\'':
escape = "&apos;";
break;
case '\"':
escape = "&quot;";
break;
}
fwrite(text, (p - text - 1), 1, f);
if (!escape)