Handle %xx encoding in querystring

Convert valid %xx expressions in querystring to ascii, ignore invalid
expressions (i.e. eat the three characters %xx).

Signed-off-by: Lars Hjemli <larsh@hal-2004.(none)>
此提交包含在:
Lars Hjemli
2007-01-04 16:53:03 +01:00
父節點 05b13194b4
當前提交 52e605caf5
共有 3 個檔案被更改,包括 36 行新增0 行删除

查看文件

@ -113,3 +113,16 @@ void *cgit_free_commitinfo(struct commitinfo *info)
free(info);
return NULL;
}
int hextoint(char c)
{
if (c >= 'a' && c <= 'f')
return 10 + c - 'a';
else if (c >= 'A' && c <= 'F')
return 10 + c - 'A';
else if (c >= '0' && c <= '9')
return c - '0';
else
return -1;
}