changeset 927:d136bc34e4ca

Debugging new string urlification
author Adam Chlipala <adamc@hcoop.net>
date Sat, 12 Sep 2009 10:31:34 -0400
parents 552c989c1601
children fe939cedf42d
files lib/js/urweb.js src/c/urweb.c
diffstat 2 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lib/js/urweb.js	Sat Sep 12 09:31:50 2009 -0400
+++ b/lib/js/urweb.js	Sat Sep 12 10:31:34 2009 -0400
@@ -473,6 +473,8 @@
 function uu(s) {
   if (s.length > 0 && s[0] == '_')
     s = s.substring(1);
+  else if (s.length >= 3 && s[0] == '%' && s[1] == '5' && (s[2] == 'f' || s[2] == 'F'))
+    s = s.substring(3);
   return unescape(s.replace(new RegExp ("\\+", "g"), " "));
 }
 
--- a/src/c/urweb.c	Sat Sep 12 09:31:50 2009 -0400
+++ b/src/c/urweb.c	Sat Sep 12 10:31:34 2009 -0400
@@ -1625,7 +1625,7 @@
 }
 
 static uw_Basis_string uw_unurlifyString_to(uw_context ctx, char *r, char *s) {
-  char *s1, *s2;
+  char *s1, *s2 = s;
   int n;
 
   if (*s2 == '_')
@@ -1633,7 +1633,7 @@
   else if (s2[0] == '%' && s2[1] == '5' && (s2[2] == 'f' || s2[2] == 'F'))
     s2 += 3;
 
-  for (s1 = r, s2 = s; *s2; ++s1, ++s2) {
+  for (s1 = r; *s2; ++s1, ++s2) {
     char c = *s2;
 
     switch (c) {