diff src/audacious/input.c @ 2394:e2aaa7dca389 trunk

[svn] - tuple->file_name coming from input plugins have a string with filename + extension, but tuple->file_name coming from input plugins without a get_song_tuple have a string with filename without extension; fix this incongruency, always pass tuple->filename with a string containing filename + extension
author giacomo
date Tue, 23 Jan 2007 16:37:13 -0800
parents ad1d7687814c
children 9b7b11176d4e
line wrap: on
line diff
--- a/src/audacious/input.c	Tue Jan 23 10:33:25 2007 -0800
+++ b/src/audacious/input.c	Tue Jan 23 16:37:13 2007 -0800
@@ -563,7 +563,7 @@
 {
     InputPlugin *ip = NULL;
     TitleInput *input;
-    gchar *tmp = NULL, *ext;
+    gchar *ext = NULL;
     gchar *filename_proxy;
 
     if (filename == NULL)
@@ -579,16 +579,14 @@
     {
         input = bmp_title_input_new();
 
-        tmp = g_strdup(filename);
-        if ((ext = strrchr(tmp, '.')))
-            *ext = '\0';
+        ext = strrchr(filename, '.');
 
         input->track_name = NULL;
         input->length = -1;
         input_get_song_info(filename, &input->track_name, &input->length);
-        input->file_name = g_path_get_basename(tmp);
-        input->file_ext = ext ? ext + 1 : NULL;
-        input->file_path = g_path_get_dirname(tmp);
+        input->file_name = g_path_get_basename(filename);
+        input->file_ext = ( ( ext != NULL ) ? g_strdup(ext + 1) : NULL );
+        input->file_path = g_path_get_dirname(filename);
     }
 
     return input;