aboutsummaryrefslogtreecommitdiffstats
path: root/lib/misc.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-05-16 00:28:16 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2010-05-16 00:28:16 +0100
commitec86b2232da72f7b0c1c0a217d94b6e15698c795 (patch)
tree008111e5ae7d47ba5547be974769bd0751ee9fd0 /lib/misc.c
parentca0981ad1e427644a33fc31fe78d63ea834f0fa0 (diff)
parent6e6b3d7c7300c5cf5cf7f1538154925fd2fe3953 (diff)
Mainline merge. (Probably mostly irrelevant for this branch, oh well.)
Diffstat (limited to 'lib/misc.c')
-rw-r--r--lib/misc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/misc.c b/lib/misc.c
index 1d36d639..c56b31f3 100644
--- a/lib/misc.c
+++ b/lib/misc.c
@@ -305,8 +305,7 @@ void http_encode( char *s )
for( i = j = 0; t[i]; i ++, j ++ )
{
- /* if( t[i] <= ' ' || ((unsigned char *)t)[i] >= 128 || t[i] == '%' ) */
- if( !isalnum( t[i] ) )
+ if( !isalnum( t[i] ) && !strchr( "._-~", t[i] ) )
{
sprintf( s + j, "%%%02X", ((unsigned char*)t)[i] );
j += 2;