# HG changeset patch # User Adam Chlipala # Date 1267128532 18000 # Node ID 420e38516dc22821c7d54f72b6be174dcc93f068 # Parent 69f1d39d3f2d21e9147ed537366d05c1c0963824 Normalize URLs to deal with page names that contain apostrophes diff -r 69f1d39d3f2d -r 420e38516dc2 src/c/request.c --- a/src/c/request.c Thu Feb 25 14:55:35 2010 -0500 +++ b/src/c/request.c Thu Feb 25 15:08:52 2010 -0500 @@ -128,6 +128,14 @@ size_t boundary_len = 0; char *inputs; const char *prefix = uw_get_url_prefix(ctx); + char *s; + + for (s = path; *s; ++s) { + if (s[0] == '%' && s[1] == '2' && s[2] == '7') { + s[0] = '\''; + memmove(s+1, s+3, strlen(s+3)+1); + } + } uw_set_currentUrl(ctx, path);