diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2010-08-18 00:23:54 +0200 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2010-08-18 00:23:54 +0200 |
commit | 4a964b563ca166002ba6cf5b4e20ab29cd8cfff3 (patch) | |
tree | b64c70b67c83b2dc0646d7163eb1e36ccfaf9e64 | |
parent | 716a779cae7bdeddb66fe99e83725384d1dcb182 (diff) |
Handle relative paths in get_raw as well.
-rw-r--r-- | commands.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -91,7 +91,11 @@ static void commands_get_raw(GSocketConnection *connection, const gchar *cmd) { } GOutputStream *os = g_io_stream_get_output_stream((GIOStream*)connection); - GFile *file = g_file_new_for_path(path); + + gchar *full_path = music_get_full_path(path); + GFile *file = g_file_new_for_path(full_path); + g_free(full_path); + GFileInputStream *is = g_file_read(file, NULL, &error); if(is == NULL) { @@ -164,12 +168,14 @@ static void commands_get_mp3(GSocketConnection *connection, const gchar *cmd) { goto commands_get_mp3_free_path; } - gchar *full_path = music_get_full_path(path); GOutputStream *os = g_io_stream_get_output_stream((GIOStream*)connection); + + gchar *full_path = music_get_full_path(path); GFile *file = g_file_new_for_path(full_path); - GFileInputStream *is = g_file_read(file, NULL, &error); g_free(full_path); + GFileInputStream *is = g_file_read(file, NULL, &error); + if(is == NULL) { g_warning(error->message); g_error_free(error); |