goobox r376 - in trunk: . src



Author: paobac
Date: Sun Apr 12 18:16:13 2009
New Revision: 376
URL: http://svn.gnome.org/viewvc/goobox?rev=376&view=rev

Log:
2009-04-12  Paolo Bacchilega  <paobac svn gnome org>

	* src/main.c: 
	
	Fixed bug #573162 â Reports "Invalid" device for all my 
	CD drives
	Patch by James Westby 


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

Modified: trunk/src/main.c
==============================================================================
--- trunk/src/main.c	(original)
+++ trunk/src/main.c	Sun Apr 12 18:16:13 2009
@@ -258,9 +258,11 @@
 CDDrive * 
 get_drive_from_device (const char *device)
 {
-	CDDrive *result = NULL;
-	char    *resolved_device = NULL;
-	GList   *scan;
+	CDDrive    *result = NULL;
+	char       *resolved_device = NULL;
+	char       *resolved_real_device = NULL;
+	const char *real_device = NULL;
+	GList      *scan;
 	
 	if (device == NULL)
 		return NULL;
@@ -277,7 +279,10 @@
 		
 		if (drive->device == NULL)
 			continue;
-		if (strcmp (drive->device, device) == 0) {
+		if (resolve_all_symlinks (drive->device, &resolved_real_device) != GNOME_VFS_OK)
+			continue;
+		real_device = get_path_from_uri (resolved_real_device);
+		if (strcmp (real_device, device) == 0) {
 			result = drive;
 			break;
 		}



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