diff options
author | Xavier Roche <xroche@users.noreply.github.com> | 2013-08-17 09:09:13 +0000 |
---|---|---|
committer | Xavier Roche <xroche@users.noreply.github.com> | 2013-08-17 09:09:13 +0000 |
commit | 2d6017ad06ed6ea571384f51705ce1e53aefb2da (patch) | |
tree | 4ee026c01b5f68204837abc898c0d7d490528b0f /src/htslib.c | |
parent | e0022540014d498ee2ba366000c91c118db52b36 (diff) |
Fixed issue 25 regarding un-encoding of characters such as # in the filename.
Diffstat (limited to 'src/htslib.c')
-rw-r--r-- | src/htslib.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/htslib.c b/src/htslib.c index 63a3abb..bb46f94 100644 --- a/src/htslib.c +++ b/src/htslib.c @@ -3708,6 +3708,8 @@ HTSEXT_API char *unescape_http(char *catbuff, const char *s) { // unescape in URL/URI ONLY what has to be escaped, to form a standard URL/URI // DOES NOT DECODE %25 (part of CHAR_DELIM) +// no_high & 1: decode high chars +// no_high & 2: decode space HTSEXT_API char *unescape_http_unharm(char *catbuff, const char *s, int no_high) { size_t i, j; @@ -3720,8 +3722,8 @@ HTSEXT_API char *unescape_http_unharm(char *catbuff, const char *s, int no_high) || CHAR_DELIM(nchar) || CHAR_UNWISE(nchar) || CHAR_LOW(nchar) /* CHAR_SPECIAL */ - || CHAR_XXAVOID(nchar) - || ( no_high && CHAR_HIG(nchar) ) + || ( CHAR_XXAVOID(nchar) && ( nchar != ' ' || ( no_high & 2) == 0 ) ) + || ( ( no_high & 1 ) && CHAR_HIG(nchar) ) ; if (!test && nchar >= 0) { /* can safely unescape */ |