diff src/cjr_print.sml @ 1656:3e7c7e200713

Fix handling of quotes in generating C literals
author Adam Chlipala <adam@chlipala.net>
date Mon, 02 Jan 2012 17:08:39 -0500
parents 8938f7b31573
children 0577be31a435
line wrap: on
line diff
--- a/src/cjr_print.sml	Mon Jan 02 16:54:18 2012 -0500
+++ b/src/cjr_print.sml	Mon Jan 02 17:08:39 2012 -0500
@@ -2388,7 +2388,7 @@
       | DPreparedStatements _ => box []
 
       | DJavaScript s => box [string "static char jslib[] = \"",
-                              string (String.toCString s),
+                              string (Prim.toCString s),
                               string "\";"]
       | DCookie s => box [string "/*",
                           space,
@@ -2863,7 +2863,7 @@
                             prefix ^ s
             in
                 box [string "if (!strncmp(request, \"",
-                     string (String.toCString s),
+                     string (Prim.toCString s),
                      string "\", ",
                      string (Int.toString (size s)),
                      string ") && (request[",
@@ -3090,10 +3090,10 @@
                           box [string "if (!str",
                                case #kind rule of
                                    Settings.Exact => box [string "cmp(s, \"",
-                                                          string (String.toCString (#pattern rule)),
+                                                          string (Prim.toCString (#pattern rule)),
                                                           string "\"))"]
                                  | Settings.Prefix => box [string "ncmp(s, \"",
-                                                           string (String.toCString (#pattern rule)),
+                                                           string (Prim.toCString (#pattern rule)),
                                                            string "\", ",
                                                            string (Int.toString (size (#pattern rule))),
                                                            string "))"],
@@ -3402,7 +3402,7 @@
                          "uw_handle",
                          "uw_input_num", "uw_cookie_sig", "uw_check_url", "uw_check_mime", "uw_check_requestHeader", "uw_check_responseHeader",
                          case onError of NONE => "NULL" | SOME _ => "uw_onError", "my_periodics",
-                         "\"" ^ String.toCString (Settings.getTimeFormat ()) ^ "\""],
+                         "\"" ^ Prim.toCString (Settings.getTimeFormat ()) ^ "\""],
              string "};",
              newline]
     end