Code

disk plugin: Remove slashed from disk-names.
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Thu, 17 May 2007 21:00:18 +0000 (23:00 +0200)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Thu, 17 May 2007 21:00:18 +0000 (23:00 +0200)
src/disk.c

index 38c161f58d6b0009fb61f9ddc3d01ec397a01dbe..5739f3697f6dce2bf29ec1ec995b05fa4aa672eb 100644 (file)
@@ -421,6 +421,13 @@ static int disk_read (void)
                minor = atoll (fields[1]);
 
                disk_name = fields[2];
+               { /* Strip slashes from disk_name */
+                       int i;
+                       for (i = 0; disk_name[i] != '\0'; i++)
+                               if (disk_name[i] == '/')
+                                       disk_name[i] = '_';
+               }
+
 
                for (ds = disklist, pre_ds = disklist; ds != NULL; pre_ds = ds, ds = ds->next)
                        if (strcmp (disk_name, ds->name) == 0)