diff options
author | Max Kellermann <max@duempel.org> | 2013-10-17 01:34:10 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-10-17 01:34:10 +0200 |
commit | eb10d08671f3c3db2049b19a9959fe8c62532f35 (patch) | |
tree | 077ef52fd50d8bddcc2d3e80210ae8518184c6d0 /src/cue | |
parent | abb0549e4b2341446f60fdef01e56bfed56cf251 (diff) | |
download | mpd-eb10d08671f3c3db2049b19a9959fe8c62532f35.tar.gz mpd-eb10d08671f3c3db2049b19a9959fe8c62532f35.tar.xz mpd-eb10d08671f3c3db2049b19a9959fe8c62532f35.zip |
CueParser: use std::string
Diffstat (limited to 'src/cue')
-rw-r--r-- | src/cue/CueParser.cxx | 7 | ||||
-rw-r--r-- | src/cue/CueParser.hxx | 4 |
2 files changed, 5 insertions, 6 deletions
diff --git a/src/cue/CueParser.cxx b/src/cue/CueParser.cxx index 584a77a81..89f450bae 100644 --- a/src/cue/CueParser.cxx +++ b/src/cue/CueParser.cxx @@ -31,7 +31,6 @@ CueParser::CueParser() :state(HEADER), tag(new Tag()), - filename(nullptr), current(nullptr), previous(nullptr), finished(nullptr), @@ -40,7 +39,6 @@ CueParser::CueParser() CueParser::~CueParser() { delete tag; - g_free(filename); if (current != nullptr) current->Free(); @@ -230,8 +228,7 @@ CueParser::Feed2(char *p) } state = WAVE; - g_free(filename); - filename = g_strdup(new_filename); + filename = new_filename; } else if (state == IGNORE_FILE) { return; } else if (strcmp(command, "TRACK") == 0) { @@ -251,7 +248,7 @@ CueParser::Feed2(char *p) } state = TRACK; - current = Song::NewRemote(filename); + current = Song::NewRemote(filename.c_str()); assert(current->tag == nullptr); current->tag = new Tag(*tag); current->tag->AddItem(TAG_TRACK, nr); diff --git a/src/cue/CueParser.hxx b/src/cue/CueParser.hxx index f259b885c..abcceaa2e 100644 --- a/src/cue/CueParser.hxx +++ b/src/cue/CueParser.hxx @@ -23,6 +23,8 @@ #include "check.h" #include "Compiler.h" +#include <string> + struct Song; struct Tag; @@ -56,7 +58,7 @@ class CueParser { Tag *tag; - char *filename; + std::string filename; /** * The song currently being edited. |