aboutsummaryrefslogtreecommitdiff
path: root/encoder.l
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2016-04-19 11:18:23 +0200
committerHanspeter Portner <dev@open-music-kontrollers.ch>2016-04-19 11:18:23 +0200
commit65ce0ebe2daf9196d56a4fbb08bf9dd70f5011d6 (patch)
tree1a9dca26d841f1ef5b6168537226f082a8906026 /encoder.l
parentdc4cd6c955f65a1a231d2e259850b46935cb8290 (diff)
downloadsherlock.lv2-65ce0ebe2daf9196d56a4fbb08bf9dd70f5011d6.tar.xz (sig)
escape ampersand in atom strings.0.1.3
Diffstat (limited to 'encoder.l')
-rw-r--r--encoder.l6
1 files changed, 6 insertions, 0 deletions
diff --git a/encoder.l b/encoder.l
index 22ff2da..0fc55a0 100644
--- a/encoder.l
+++ b/encoder.l
@@ -110,6 +110,7 @@ enum {
TK_NEWLINE,
TK_LT,
TK_GT,
+ TK_AMP,
TK_NAME,
TK_BADCHAR
};
@@ -160,6 +161,7 @@ eol [\n\r]
{eol} return TK_NEWLINE;
"<" return TK_LT;
">" return TK_GT;
+ "&" return TK_AMP;
. return TK_RAW;
}
@@ -173,6 +175,7 @@ eol [\n\r]
{eol} return TK_NEWLINE;
"<" return TK_LT;
">" return TK_GT;
+ "&" return TK_AMP;
. return TK_RAW;
}
@@ -260,6 +263,9 @@ ttl_to_markup(const char *utf8, FILE *f)
case TK_GT:
_add_plain("&gt;");
break;
+ case TK_AMP:
+ _add_plain("&amp;");
+ break;
case TK_BADCHAR:
break;