diff --git a/ChangeLog b/ChangeLog index 48279b6a..986c2d6a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-03-05 Tatsuhiro Tsujikawa + + Use Util::pathJoin() + * src/MetalinkParserController.cc + * test/test.xml + 2009-03-05 Tatsuhiro Tsujikawa Use Util::pathJoin() diff --git a/src/MetalinkParserController.cc b/src/MetalinkParserController.cc index 205caf61..4dd3eb6d 100644 --- a/src/MetalinkParserController.cc +++ b/src/MetalinkParserController.cc @@ -33,6 +33,9 @@ */ /* copyright --> */ #include "MetalinkParserController.h" + +#include + #include "Metalinker.h" #include "MetalinkEntry.h" #include "MetalinkResource.h" @@ -45,7 +48,7 @@ # include "messageDigest.h" #endif // ENABLE_MESSAGE_DIGEST #include "Signature.h" -#include +#include "Util.h" namespace aria2 { @@ -77,10 +80,14 @@ void MetalinkParserController::setFileNameOfEntry(const std::string& filename) if(_tEntry.isNull()) { return; } + std::deque 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); } } diff --git a/test/test.xml b/test/test.xml index 9d4e8671..54e989ce 100644 --- a/test/test.xml +++ b/test/test.xml @@ -28,7 +28,7 @@ fffff http://httphost/aria2-0.5.2.tar.bz2 - + 345689 0.5.1 ja-JP