decoder/Plugin: container_scan() returns AllocatedString

This commit is contained in:
Max Kellermann
2016-04-13 12:19:42 +02:00
parent 8ba3378096
commit cd041f8574
4 changed files with 11 additions and 12 deletions

View File

@@ -31,6 +31,7 @@
#include "tag/TagHandler.hxx"
#include "tag/TagBuilder.hxx"
#include "Log.hxx"
#include "util/AllocatedString.hxx"
Directory *
UpdateWalk::MakeDirectoryIfModified(Directory &parent, const char *name,
@@ -95,16 +96,16 @@ UpdateWalk::UpdateContainerFile(Directory &directory,
return false;
}
char *vtrack;
AllocatedString<> vtrack = nullptr;
unsigned int tnum = 0;
TagBuilder tag_builder;
while ((vtrack = plugin.container_scan(pathname, ++tnum)) != nullptr) {
Song *song = Song::NewFile(vtrack, *contdir);
Song *song = Song::NewFile(vtrack.c_str(), *contdir);
// shouldn't be necessary but it's there..
song->mtime = info.mtime;
const auto vtrack_fs = AllocatedPath::FromUTF8(vtrack);
const auto vtrack_fs = AllocatedPath::FromUTF8(vtrack.c_str());
// TODO: check vtrack_fs.IsNull()
const auto child_path_fs = AllocatedPath::Build(pathname,
@@ -122,8 +123,7 @@ UpdateWalk::UpdateContainerFile(Directory &directory,
modified = true;
FormatDefault(update_domain, "added %s/%s",
directory.GetPath(), vtrack);
delete[] vtrack;
directory.GetPath(), vtrack.c_str());
}
if (tnum == 1) {