]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/url.c
Merge branch 'dev-lib'
[libucw.git] / ucw / url.c
index 50ed2f7ecd03d840728472d153053b47ab6cdf91..4b0ddeaa0be11ee6a9b8d7ddf8269f5922e07ae1 100644 (file)
--- a/ucw/url.c
+++ b/ucw/url.c
@@ -92,12 +92,14 @@ url_deescape(const char *s, char *d)
              val = NCC_AND; break;
            case '#':
              val = NCC_HASH; break;
              val = NCC_AND; break;
            case '#':
              val = NCC_HASH; break;
+#ifndef CONFIG_URL_ESCAPE_COMPAT
            case '$':
              val = NCC_DOLLAR; break;
            case '+':
              val = NCC_PLUS; break;
            case ',':
              val = NCC_COMMA; break;
            case '$':
              val = NCC_DOLLAR; break;
            case '+':
              val = NCC_PLUS; break;
            case ',':
              val = NCC_COMMA; break;
+#endif
            }
          *d++ = val;
          s += 3;
            }
          *d++ = val;
          s += 3;
@@ -137,11 +139,14 @@ url_enescape(const char *s, char *d)
       if (d >= end)
        return URL_ERR_TOO_LONG;
       if (Calnum(c) ||                                                 /* RFC 2396 (2.1-2.3): Only alphanumerics ... */
       if (d >= end)
        return URL_ERR_TOO_LONG;
       if (Calnum(c) ||                                                 /* RFC 2396 (2.1-2.3): Only alphanumerics ... */
-         c == '-' || c == '_' || c == '.' || c == '+' || c == '~' ||   /* ... and several other exceptions ... */
-         c == '!' || c == '*' || c == '\'' || c == '(' || c == ')' ||
-         c == '/' || c == '?' || c == ':' || c == '@' ||               /* ... and reserved chars used for reserved purpose */
-         c == '=' || c == '&' || c == '#' || c == ';' ||
-         c == '$' || c == '+' || c == ',')
+         c == '!' || c == '*' || c == '\'' || c == '(' || c == ')' ||  /* ... and some exceptions and reserved chars */
+         c == '$' || c == '-' || c == '_' || c == '.' || c == '+' ||
+         c == ',' || c == '=' || c == '&' || c == '#' || c == ';' ||
+         c == '/' || c == '?' || c == ':' || c == '@'
+#ifndef CONFIG_URL_ESCAPE_COMPAT
+         || c == '~'
+#endif
+       )
        *d++ = *s++;
       else
        {
        *d++ = *s++;
       else
        {