stored_playlist: use the text_file library to read lines
This commit is contained in:
parent
5274fee8a7
commit
4f48c10312
|
@ -20,6 +20,7 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "stored_playlist.h"
|
#include "stored_playlist.h"
|
||||||
#include "playlist_save.h"
|
#include "playlist_save.h"
|
||||||
|
#include "text_file.h"
|
||||||
#include "song.h"
|
#include "song.h"
|
||||||
#include "mapper.h"
|
#include "mapper.h"
|
||||||
#include "path.h"
|
#include "path.h"
|
||||||
|
@ -179,7 +180,6 @@ spl_load(const char *utf8path)
|
||||||
{
|
{
|
||||||
FILE *file;
|
FILE *file;
|
||||||
GPtrArray *list;
|
GPtrArray *list;
|
||||||
char buffer[MPD_PATH_MAX];
|
|
||||||
char *path_fs;
|
char *path_fs;
|
||||||
|
|
||||||
if (!spl_valid_name(utf8path) || map_spl_path() == NULL)
|
if (!spl_valid_name(utf8path) || map_spl_path() == NULL)
|
||||||
|
@ -196,14 +196,12 @@ spl_load(const char *utf8path)
|
||||||
|
|
||||||
list = g_ptr_array_new();
|
list = g_ptr_array_new();
|
||||||
|
|
||||||
while (fgets(buffer, sizeof(buffer), file)) {
|
GString *buffer = g_string_sized_new(1024);
|
||||||
char *s = buffer;
|
char *s;
|
||||||
|
while ((s = read_text_line(file, buffer)) != NULL) {
|
||||||
if (*s == PLAYLIST_COMMENT)
|
if (*s == PLAYLIST_COMMENT)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
g_strchomp(buffer);
|
|
||||||
|
|
||||||
if (!uri_has_scheme(s)) {
|
if (!uri_has_scheme(s)) {
|
||||||
char *path_utf8;
|
char *path_utf8;
|
||||||
struct song *song;
|
struct song *song;
|
||||||
|
|
Loading…
Reference in New Issue