fix crash upon invalid mountpoint
authorAndreas Frisch <andreas.frisch@multimedia-labs.de>
Sun, 26 Oct 2008 19:54:09 +0000 (19:54 +0000)
committerAndreas Frisch <andreas.frisch@multimedia-labs.de>
Sun, 26 Oct 2008 19:54:09 +0000 (19:54 +0000)
lib/python/Components/Scanner.py

index 95e2e8f5679bc07f0c456d72d5f53d65107c8549..d944c4c795bdb29fb4addf433bdf06a3491b56ac 100644 (file)
@@ -134,7 +134,7 @@ def scanDevice(mountpoint):
        paths_to_scan = list(paths_to_scan)
        
        from Components.Harddisk import harddiskmanager 
        paths_to_scan = list(paths_to_scan)
        
        from Components.Harddisk import harddiskmanager 
-       blockdev = mountpoint.split('/')[2]
+       blockdev = mountpoint.rsplit('/',1)[-1]
        error, blacklisted, removable, is_cdrom, partitions = harddiskmanager.getBlockDevInfo(blockdev)
 
        # now scan the paths
        error, blacklisted, removable, is_cdrom, partitions = harddiskmanager.getBlockDevInfo(blockdev)
 
        # now scan the paths