summaryrefslogtreecommitdiff
path: root/plparse/totem-pl-parser-wm.c
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@gmail.com>2009-05-04 15:34:07 +1000
committerRobert Ancell <robert.ancell@gmail.com>2009-05-04 15:34:07 +1000
commit34c3024ba5792965d8662642bb8a7e47ac44300c (patch)
tree12499cc77ee060482075a58c57e814033100d79a /plparse/totem-pl-parser-wm.c
parent311e1f342d16c7edef0565473382066403b8eda5 (diff)
downloadtotem-pl-parser-34c3024ba5792965d8662642bb8a7e47ac44300c.tar.gz
Handle all types of newline characters in playlists by splitting on both \n and \r (Closes: #579905)
Diffstat (limited to 'plparse/totem-pl-parser-wm.c')
-rw-r--r--plparse/totem-pl-parser-wm.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/plparse/totem-pl-parser-wm.c b/plparse/totem-pl-parser-wm.c
index 8a0692b..94d48e6 100644
--- a/plparse/totem-pl-parser-wm.c
+++ b/plparse/totem-pl-parser-wm.c
@@ -84,23 +84,17 @@ totem_pl_parser_add_asf_reference_parser (TotemPlParser *parser,
GFile *base_file,
gpointer data)
{
- char *contents, **lines, *ref, *split_char;
+ char *contents, **lines, *ref;
gsize size;
if (g_file_load_contents (file, NULL, &contents, &size, NULL, NULL) == FALSE)
return TOTEM_PL_PARSER_RESULT_ERROR;
- if (strstr(contents,"\x0d") == NULL) {
- split_char = "\n";
- } else {
- split_char = "\x0d\n";
- }
-
- lines = g_strsplit (contents, split_char, 0);
+ lines = g_strsplit_set (contents, "\n\r", 0);
g_free (contents);
/* Try to get Ref1 first */
- ref = totem_pl_parser_read_ini_line_string (lines, "Ref1", FALSE);
+ ref = totem_pl_parser_read_ini_line_string (lines, "Ref1");
if (ref == NULL) {
g_strfreev (lines);
return totem_pl_parser_add_asx (parser, file, base_file, data);