added: do a urldecode on the filename

This commit is contained in:
Bob van Loosen 2013-04-06 16:44:26 +02:00
parent e7a9e0b4df
commit e15b95ae2b
2 changed files with 15 additions and 2 deletions

View file

@ -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;
}

View file

@ -23,6 +23,7 @@ def configure(conf):
conf.check(header_name='samplerate.h')
conf.check(header_name='sys/ipc.h')
conf.check(header_name='sys/shm.h')
conf.check(header_name='uriparser/Uri.h')
if not conf.options.disable_vlc:
conf.check(header_name='vlc/vlc.h')
@ -38,6 +39,7 @@ def configure(conf):
conf.check(lib='X11', uselib_store='X11')
conf.check(lib='Xext', uselib_store='Xext')
conf.check(lib='Xrender', uselib_store='Xrender')
conf.check(lib='uriparser', uselib_store='uriparser')
conf.check(lib='m', uselib_store='m', mandatory=False)
conf.check(lib='pthread', uselib_store='pthread', mandatory=False)
@ -64,7 +66,7 @@ def build(bld):
src/util/condition.cpp\
src/util/tcpsocket.cpp\
src/util/thread.cpp',
use=['m','pthread','rt', 'jack', 'fftw3', 'fftw3f', 'samplerate', 'X11', 'Xrender'],
use=['m','pthread','rt', 'jack', 'fftw3', 'fftw3f', 'samplerate', 'uriparser', 'X11', 'Xrender'],
includes='./src',
cxxflags='-Wall -g -DUTILNAMESPACE=BitVisUtil -O3 -march=native',
target='bitvis')