tools: gst-play: Use g_build_filename instead of g_strconcat
authorVivia Nikolaidou <vivia@ahiru.eu>
Tue, 18 Aug 2015 10:50:17 +0000 (13:50 +0300)
committerSebastian Dröge <sebastian@centricular.com>
Tue, 18 Aug 2015 12:19:03 +0000 (15:19 +0300)
When running gst-play against a directory name, and suffix the path with a
directory separator (e.g. tab completion), gst-play was printing two directory
separators in a row. g_build_filename fixes this, and additionally allows for
both '/' and '\' as separators on Windows.

tools/gst-play.c

index bbcde11..15c9aa2 100644 (file)
@@ -641,7 +641,7 @@ add_to_playlist (GPtrArray * playlist, const gchar * filename)
     while ((entry = g_dir_read_name (dir))) {
       gchar *path;
 
-      path = g_strconcat (filename, G_DIR_SEPARATOR_S, entry, NULL);
+      path = g_build_filename (filename, entry, NULL);
       files = g_list_insert_sorted (files, path, compare);
     }