diff src/c/urweb.c @ 917:321a2d6feb40

dragList demo working, save for Gecko load delay and highlighting
author Adam Chlipala <adamc@hcoop.net>
date Tue, 08 Sep 2009 10:55:49 -0400
parents b873feb3eb52
children ae0110465421
line wrap: on
line diff
--- a/src/c/urweb.c	Tue Sep 08 10:18:19 2009 -0400
+++ b/src/c/urweb.c	Tue Sep 08 10:55:49 2009 -0400
@@ -2556,6 +2556,7 @@
     char *start = strstr(ctx->page.start, "<sc>");
     if (start) {
       buf_check(&ctx->page, buf_used(&ctx->page) - 4 + len);
+      start = strstr(ctx->page.start, "<sc>");
       memmove(start + len, start + 4, buf_used(&ctx->page) - (start - ctx->page.start) - 3);
       ctx->page.front += len - 4;
       memcpy(start, ctx->script_header, len);
@@ -2566,13 +2567,13 @@
     char *start = strstr(ctx->page.start, "<sc>");
     if (start) {
       buf_check(&ctx->page, buf_used(&ctx->page) - 4 + lenP);
+      start = strstr(ctx->page.start, "<sc>");
       memmove(start + lenP, start + 4, buf_used(&ctx->page) - (start - ctx->page.start) - 3);
       ctx->page.front += lenP - 4;
       memcpy(start, ctx->script_header, lenH);
       memcpy(start + lenH, "<script type=\"text/javascript\">", 31);
       memcpy(start + lenH + 31, ctx->script.start, len);
       memcpy(start + lenH + 31 + len, "</script>", 9);
-      printf("start=%s\n", start);
     }
   }
 }