added: do a urldecode on the filename
This commit is contained in:
parent
e7a9e0b4df
commit
e15b95ae2b
2 changed files with 15 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
|||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <sstream>
|
||||
#include <uriparser/Uri.h>
|
||||
|
||||
#include "mpdclient.h"
|
||||
#include "util/timeutils.h"
|
||||
|
@ -315,6 +316,16 @@ std::string CMpdClient::StripFilename(const std::string& filename)
|
|||
else
|
||||
nchars = end - start;
|
||||
|
||||
return filename.substr(start, nchars);
|
||||
string stripped = filename.substr(start, nchars);
|
||||
|
||||
//do a url decode
|
||||
char* tmp = new char[stripped.length() + 1];
|
||||
strcpy(tmp, stripped.c_str());
|
||||
uriUnescapeInPlaceA(tmp);
|
||||
|
||||
stripped = tmp;
|
||||
delete[] tmp;
|
||||
|
||||
return stripped;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue