Skip to content

Commit 1631f74

Browse files
committed
Disk (Linux): revisits 78c6d71
1 parent 78c6d71 commit 1631f74

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Features:
1313
* Adds basic support for Wine (Windows)
1414
* Adds basic support for hppa and sh architectures (CPU, Linux)
1515
* Improves T-Head SoC name detection from the device tree (#1997, CPU, Linux)
16+
* `Disk.hideFolders` now supports glob patterns (Disk)
17+
* For example, `/boot/*` will match both `/boot/efi` and `/boot/firmware`
1618

1719
Bugfixes:
1820
* Avoids integer overflow when calculating swap size (#1988, Swap, Windows)

doc/json_schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2326,7 +2326,7 @@
23262326
]
23272327
},
23282328
"hideFolders": {
2329-
"description": "A list of folder paths to hide from the disk output",
2329+
"description": "A list of folder paths (or glob patterns) to hide from the disk output",
23302330
"oneOf": [
23312331
{
23322332
"type": "string",
@@ -2342,7 +2342,7 @@
23422342
"uniqueItems": true
23432343
}
23442344
],
2345-
"default": "/efi:/boot:/boot/efi:/boot/firmware"
2345+
"default": "/efi:/boot:/boot/*"
23462346
},
23472347
"hideFS": {
23482348
"description": "A list of file systems to hide from the disk output",

src/modules/disk/disk.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -230,11 +230,8 @@ bool ffPrintDisk(FFDiskOptions* options)
230230
if(__builtin_expect(options->folders.length == 0, 1) && (disk->type & ~options->showTypes))
231231
continue;
232232

233-
if (options->hideFolders.length)
234-
{
235-
if (isMatchFolders(&options->hideFolders, &disk->mountpoint, FF_DISK_FOLDER_SEPARATOR))
236-
continue;
237-
}
233+
if (options->hideFolders.length && isMatchFolders(&options->hideFolders, &disk->mountpoint, FF_DISK_FOLDER_SEPARATOR))
234+
continue;
238235

239236
if (options->hideFS.length && ffStrbufSeparatedContain(&options->hideFS, &disk->filesystem, ':'))
240237
continue;
@@ -482,7 +479,7 @@ void ffInitDiskOptions(FFDiskOptions* options)
482479
#if _WIN32 || __APPLE__ || __ANDROID__
483480
ffStrbufInit(&options->hideFolders);
484481
#else
485-
ffStrbufInitS(&options->hideFolders, "/efi:/boot:/boot/efi:/boot/firmware");
482+
ffStrbufInitS(&options->hideFolders, "/efi:/boot:/boot/*");
486483
#endif
487484
ffStrbufInit(&options->hideFS);
488485
options->showTypes = FF_DISK_VOLUME_TYPE_REGULAR_BIT | FF_DISK_VOLUME_TYPE_EXTERNAL_BIT | FF_DISK_VOLUME_TYPE_READONLY_BIT;

0 commit comments

Comments
 (0)