]> git.tdb.fi Git - ext/subsurface.git/commitdiff
Add single and double quotes to escaped characters in XML output
authorDirk Hohndel <dirk@hohndel.org>
Mon, 27 Aug 2012 16:38:23 +0000 (09:38 -0700)
committerDirk Hohndel <dirk@hohndel.org>
Mon, 27 Aug 2012 16:38:23 +0000 (09:38 -0700)
We already escape '<', '>', and '&'. This adds the remaining two special
entities in XML: '\'' and '\"'.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
save-xml.c

index 37d6d062eabf836f188b8cfc2bcd0b6feae0c6a4..6b08c95111977282169a6cef3a10bbe5384d02b7 100644 (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)