diff src/c/urweb.c @ 1457:aa2398e58306

Escape less-than in JavaScript strings
author Adam Chlipala <adam@chlipala.net>
date Thu, 12 May 2011 17:14:13 -0400
parents b6ce8ef0ea88
children fb88d64abec8
line wrap: on
line diff
--- a/src/c/urweb.c	Fri May 06 20:51:40 2011 -0430
+++ b/src/c/urweb.c	Thu May 12 17:14:13 2011 -0400
@@ -1380,6 +1380,10 @@
       strcpy(s2, "\\\\");
       s2 += 2;
       break;
+    case '<':
+      strcpy(s2, "\\074");
+      s2 += 4;
+      break;
     default:
       if (isprint((int)c) || c >= 128)
         *s2++ = c;
@@ -1417,6 +1421,10 @@
     strcpy(s2, "\\\\");
     s2 += 2;
     break;
+  case '<':
+    strcpy(s2, "\\074");
+    s2 += 4;
+    break;
   default:
     if (isprint((int)c) || c >= 128)
       *s2++ = c;
@@ -1451,6 +1459,10 @@
       strcpy(s2, "\\\\");
       s2 += 2;
       break;
+    case '<':
+      strcpy(s2, "\\074");
+      s2 += 4;
+      break;
     default:
       if (isprint((int)c) || c >= 128)
         *s2++ = c;