aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2006-01-10 15:36:49 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2006-01-10 15:36:49 +0100
commitdd8d4c5243eea91dd3b0709ae76abdd3743e99bc (patch)
tree6260da3a7609b90f58128953f45be98227515abc
parent4fe4be2723eba3b7f3640396a1c8fa80b39fe2ab (diff)
http_encode() now just escapes everything except [A-Za-z0-9]. Should fix #83.
-rw-r--r--util.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/util.c b/util.c
index e4b58090..db783fe0 100644
--- a/util.c
+++ b/util.c
@@ -35,6 +35,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <ctype.h>
#include <glib.h>
#include <time.h>
@@ -376,7 +377,8 @@ void http_encode( char *s )
for( i = j = 0; t[i]; i ++, j ++ )
{
- if( t[i] <= ' ' || ((unsigned char *)t)[i] >= 128 || t[i] == '%' )
+ /* if( t[i] <= ' ' || ((unsigned char *)t)[i] >= 128 || t[i] == '%' ) */
+ if( !isalnum( t[i] ) )
{
sprintf( s + j, "%%%02X", ((unsigned char*)t)[i] );
j += 2;