mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 04:43:10 +00:00
Fix URL character encoding bug in mimedb
darcs-hash:20070417062932-ac50b-7816e307ab180be02fc247f6c4796e7fa774862d.gz
This commit is contained in:
parent
52f9560b4f
commit
90c5cea43d
1 changed files with 3 additions and 2 deletions
5
mimedb.c
5
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++;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue