mirror of
https://github.com/emikulic/darkhttpd.git
synced 2023-08-10 21:13:08 +03:00
is_bad_char -> needs_urlencoding, whitespace fixes.
This commit is contained in:
parent
b02c1bba08
commit
ca6a07f714
@ -1693,7 +1693,7 @@ static void cleanup_sorted_dirlist(struct dlent **list, const ssize_t size)
|
||||
/* ---------------------------------------------------------------------------
|
||||
* Should this character be urlencoded (according to rfc1738)
|
||||
*/
|
||||
static int is_bad_char(unsigned char c)
|
||||
static int needs_urlencoding(unsigned char c)
|
||||
{
|
||||
int i;
|
||||
const static char bad[] = "<>\"%{}|^~[]`\\;:/?@#=&";
|
||||
@ -1721,7 +1721,7 @@ static void urlencode_filename(unsigned char *name, unsigned char *safe_url)
|
||||
|
||||
for (i=j=0; i<len; i++)
|
||||
{
|
||||
if (is_bad_char(name[i]))
|
||||
if (needs_urlencoding(name[i]))
|
||||
{
|
||||
safe_url[j++] = '%';
|
||||
safe_url[j++] = hex[(name[i] >> 4) & 0xF];
|
||||
|
Loading…
Reference in New Issue
Block a user