diff options
author | Peter Mikkelsen <petermikkelsen10@gmail.com> | 2024-04-07 13:25:49 +0200 |
---|---|---|
committer | Peter Mikkelsen <petermikkelsen10@gmail.com> | 2024-04-07 13:25:49 +0200 |
commit | 9cb56dabb676391a9382731347e8d2b07b9437a5 (patch) | |
tree | 95302f041497679202722d9896ec1386bed2d86c /bin/contrib/rc-httpd/lib/urldecode.awk | |
parent | 0a37a1cc5909e11098963267edc9654b85e7ce16 (diff) |
big cleanup
Diffstat (limited to 'bin/contrib/rc-httpd/lib/urldecode.awk')
-rwxr-xr-x | bin/contrib/rc-httpd/lib/urldecode.awk | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/bin/contrib/rc-httpd/lib/urldecode.awk b/bin/contrib/rc-httpd/lib/urldecode.awk deleted file mode 100755 index 1dadd00..0000000 --- a/bin/contrib/rc-httpd/lib/urldecode.awk +++ /dev/null @@ -1,39 +0,0 @@ -# taken from werc -BEGIN { - hextab ["0"] = 0; hextab ["8"] = 8; - hextab ["1"] = 1; hextab ["9"] = 9; - hextab ["2"] = 2; hextab ["A"] = hextab ["a"] = 10 - hextab ["3"] = 3; hextab ["B"] = hextab ["b"] = 11; - hextab ["4"] = 4; hextab ["C"] = hextab ["c"] = 12; - hextab ["5"] = 5; hextab ["D"] = hextab ["d"] = 13; - hextab ["6"] = 6; hextab ["E"] = hextab ["e"] = 14; - hextab ["7"] = 7; hextab ["F"] = hextab ["f"] = 15; -} -{ - decoded = "" - i = 1 - len = length ($0) - while ( i <= len ) { - c = substr ($0, i, 1) - if ( c == "%" ) { - if ( i+2 <= len ) { - c1 = substr ($0, i+1, 1) - c2 = substr ($0, i+2, 1) - if ( hextab [c1] == "" || hextab [c2] == "" ) { - print "WARNING: invalid hex encoding: %" c1 c2 | "cat >&2" - } else { - code = 0 + hextab [c1] * 16 + hextab [c2] + 0 - c = sprintf ("%c", code) - i = i + 2 - } - } else { - print "WARNING: invalid % encoding: " substr ($0, i, len - i) - } - } else if ( c == "+" ) { - c = " " - } - decoded = decoded c - ++i - } - printf "%s", decoded -} |