diff --git a/src/plugins/btrfs.c b/src/plugins/btrfs.c index 2abc8fbf..258ae1c4 100644 --- a/src/plugins/btrfs.c +++ b/src/plugins/btrfs.c @@ -651,7 +651,7 @@ BDBtrfsSubvolumeInfo** bd_btrfs_list_subvolumes (const gchar *mountpoint, gboole gchar const * const pattern = "ID\\s+(?P\\d+)\\s+gen\\s+\\d+\\s+(cgen\\s+\\d+\\s+)?" \ "parent\\s+(?P\\d+)\\s+top\\s+level\\s+\\d+\\s+" \ "(otime\\s+(\\d{4}-\\d{2}-\\d{2}\\s+\\d\\d:\\d\\d:\\d\\d|-)\\s+)?"\ - "path\\s+(/)?(?P\\S+)"; + "path\\s+(/)?(?P.+)"; GRegex *regex = NULL; GMatchInfo *match_info = NULL; guint64 i = 0; diff --git a/tests/btrfs_test.py b/tests/btrfs_test.py index 82da2fd6..5057e324 100644 --- a/tests/btrfs_test.py +++ b/tests/btrfs_test.py @@ -358,6 +358,13 @@ def test_list_subvolumes(self): self.assertEqual(subvols[0].path, "subvol1") self.assertEqual(subvols[1].path, "subvol1/bar") + # test also subvolumes with spaces in name + succ = BlockDev.btrfs_create_subvolume(TEST_MNT, "subvol with spaces", None) + self.assertTrue(succ) + + subvols = BlockDev.btrfs_list_subvolumes(TEST_MNT, False) + self.assertTrue(any(subvol.path == "subvol with spaces" for subvol in subvols)) + @tag_test(TestTags.CORE) def test_list_subvolumes_different_mount(self): """Verify that it is possible get to info about subvolumes with subvol= mount option"""