aboutsummaryrefslogtreecommitdiffhomepage
path: root/mimedb.c
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2007-04-17 16:29:32 +1000
committerGravatar axel <axel@liljencrantz.se>2007-04-17 16:29:32 +1000
commit90c5cea43d2631d7417c951fe74c925e24de2dc7 (patch)
treed798c72525af6378ec852a6382f63a0143a631e3 /mimedb.c
parent52f9560b4f2f884142895b646a56f97d3882d028 (diff)
Fix URL character encoding bug in mimedb
darcs-hash:20070417062932-ac50b-7816e307ab180be02fc247f6c4796e7fa774862d.gz
Diffstat (limited to 'mimedb.c')
-rw-r--r--mimedb.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mimedb.c b/mimedb.c
index f0ed8ff4..7add90db 100644
--- a/mimedb.c
+++ b/mimedb.c
@@ -742,6 +742,7 @@ static void writer_hex( int num )
int a, b;
a = num /16;
b = num %16;
+
writer( a>9?('A'+a-10):('0'+a));
writer( b>9?('A'+b-10):('0'+b));
}
@@ -830,7 +831,7 @@ static void write_url( char *file )
if( ((*str >= 'a') && (*str <='z')) ||
((*str >= 'A') && (*str <='Z')) ||
((*str >= '0') && (*str <='9')) ||
- (strchr( "./_",*str) != 0) )
+ (strchr( "-_.~/",*str) != 0) )
{
writer(*str);
}
@@ -842,7 +843,7 @@ static void write_url( char *file )
else
{
writer( '%' );
- writer_hex( *str );
+ writer_hex( (unsigned char)*str );
}
str++;
}