summaryrefslogtreecommitdiff
path: root/src/cjr_print.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2010-08-10 15:55:43 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2010-08-10 15:55:43 -0400
commit06f9a1fcbb40856fae744e49be3bf0e166246293 (patch)
tree407556eab027f66694f1ddc3a0d4c1813e1b120f /src/cjr_print.sml
parent55a669bc95cb2831f5a4fc084d2aa828863a1f07 (diff)
Better UTF-8 escaping for JavaScript and SQL literals
Diffstat (limited to 'src/cjr_print.sml')
-rw-r--r--src/cjr_print.sml8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cjr_print.sml b/src/cjr_print.sml
index 34936aac..412531a6 100644
--- a/src/cjr_print.sml
+++ b/src/cjr_print.sml
@@ -2128,7 +2128,7 @@ fun p_decl env (dAll as (d, _) : decl) =
| DPreparedStatements _ => box []
| DJavaScript s => box [string "static char jslib[] = \"",
- string (String.toString s),
+ string (String.toCString s),
string "\";"]
| DCookie s => box [string "/*",
space,
@@ -2585,7 +2585,7 @@ fun p_file env (ds, ps) =
prefix ^ s
in
box [string "if (!strncmp(request, \"",
- string (String.toString s),
+ string (String.toCString s),
string "\", ",
string (Int.toString (size s)),
string ") && (request[",
@@ -2761,10 +2761,10 @@ fun p_file env (ds, ps) =
box [string "if (!str",
case #kind rule of
Settings.Exact => box [string "cmp(s, \"",
- string (String.toString (#pattern rule)),
+ string (String.toCString (#pattern rule)),
string "\"))"]
| Settings.Prefix => box [string "ncmp(s, \"",
- string (String.toString (#pattern rule)),
+ string (String.toCString (#pattern rule)),
string "\", ",
string (Int.toString (size (#pattern rule))),
string "))"],