sound-juicer r2309 - in trunk: . src



Author: rburton
Date: Mon Sep  8 09:46:06 2008
New Revision: 2309
URL: http://svn.gnome.org/viewvc/sound-juicer?rev=2309&view=rev

Log:
2008-09-08  Ross Burton  <ross burtonini com>

	* src/sj-main.c:
	Correctly parse CDDA URLs (#550131, thanks Matthew Martin)


Modified:
   trunk/ChangeLog
   trunk/src/sj-main.c

Modified: trunk/src/sj-main.c
==============================================================================
--- trunk/src/sj-main.c	(original)
+++ trunk/src/sj-main.c	Mon Sep  8 09:46:06 2008
@@ -1813,10 +1813,12 @@
 
       /* Mash up the CDDA URIs into a device path */
       if (g_str_has_prefix (uris[0], "cdda://")) {
-        guint len;
-        d = g_strdup_printf ("/dev/%s", uris[0] + strlen ("cdda://"));
-        len = strlen (d);
-        d[len - 1] = '\0';
+      	gint len;
+        d = g_strdup_printf ("/dev/%s%c", uris[0] + strlen ("cdda://"), '\0');
+        /* Take last '/' out of path, or set_device thinks it is part of the device name */
+		len = strlen (d);
+		if (d[len - 1] == '/')
+			d [len - 1] = '\0';
 	set_device (d, TRUE);
 	g_free (d);
       } else {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]