2009-03-05 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

Use Util::pathJoin()
	* src/MetalinkParserController.cc
	* test/test.xml
pull/1/head
Tatsuhiro Tsujikawa 2009-03-04 15:56:56 +00:00
parent 27ff58c06e
commit 4aae48c9b2
3 changed files with 17 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2009-03-05 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use Util::pathJoin()
* src/MetalinkParserController.cc
* test/test.xml
2009-03-05 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use Util::pathJoin()

View File

@ -33,6 +33,9 @@
*/
/* copyright --> */
#include "MetalinkParserController.h"
#include <algorithm>
#include "Metalinker.h"
#include "MetalinkEntry.h"
#include "MetalinkResource.h"
@ -45,7 +48,7 @@
# include "messageDigest.h"
#endif // ENABLE_MESSAGE_DIGEST
#include "Signature.h"
#include <algorithm>
#include "Util.h"
namespace aria2 {
@ -77,10 +80,14 @@ void MetalinkParserController::setFileNameOfEntry(const std::string& filename)
if(_tEntry.isNull()) {
return;
}
std::deque<std::string> elements;
Util::slice(elements, filename, '/');
std::string path = Util::joinPath(elements.begin(), elements.end());
if(_tEntry->file.isNull()) {
_tEntry->file.reset(new FileEntry(filename, 0, 0));
_tEntry->file.reset(new FileEntry(path, 0, 0));
} else {
_tEntry->file->setPath(filename);
_tEntry->file->setPath(path);
}
}

View File

@ -28,7 +28,7 @@ fffff
<url type="http" location="us" preference="100">http://httphost/aria2-0.5.2.tar.bz2</url>
</resources>
</file>
<file name="aria2-0.5.1.tar.bz2">
<file name="dir/../aria2-0.5.1.tar.bz2">
<size>345689</size>
<version>0.5.1</version>
<language>ja-JP</language>