avformat/urldecode: add the ability to not decode plus sign to space

Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
Marton Balint
2020-02-04 23:44:28 +01:00
parent 6a7b5226e1
commit 8224f1e0ba
3 changed files with 6 additions and 5 deletions

View File

@@ -32,7 +32,7 @@
#include "libavutil/avstring.h"
#include "urldecode.h"
char *ff_urldecode(const char *url)
char *ff_urldecode(const char *url, int decode_plus_sign)
{
int s = 0, d = 0, url_len = 0;
char c;
@@ -74,7 +74,7 @@ char *ff_urldecode(const char *url)
dest[d++] = c2;
dest[d++] = c3;
}
} else if (c == '+') {
} else if (c == '+' && decode_plus_sign) {
dest[d++] = ' ';
} else {
dest[d++] = c;