mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-12 14:31:00 +01:00
Disk (Linux): fix label detection
This commit is contained in:
1 parent
e6be90614a
commit
98b9ef74cf
3 files changed
+10
-10
No files matched your search
@@ -122,20 +122,16 @@ static void detectName(FFDisk* disk, const FFstrbuf* device)
|
||||
|
||||
FF_STRBUF_AUTO_DESTROY basePath = ffStrbufCreate();
|
||||
|
||||
//Try partlabel first
|
||||
ffStrbufSetS(&basePath, "/dev/disk/by-partlabel/");
|
||||
//Try label first
|
||||
ffStrbufSetS(&basePath, "/dev/disk/by-label/");
|
||||
detectNameFromPath(disk, &deviceStat, &basePath);
|
||||
|
||||
//Try label second
|
||||
if(disk->name.length == 0)
|
||||
{
|
||||
ffStrbufSetS(&basePath, "/dev/disk/by-label/");
|
||||
//Try partlabel second
|
||||
ffStrbufSetS(&basePath, "/dev/disk/by-partlabel/");
|
||||
detectNameFromPath(disk, &deviceStat, &basePath);
|
||||
}
|
||||
|
||||
//Use the mountpoint as a last resort
|
||||
if(disk->name.length == 0)
|
||||
ffStrbufAppend(&disk->name, &disk->mountpoint);
|
||||
}
|
||||
|
||||
#ifdef __ANDROID__
|
||||
|
||||
Reference in new issue
Block a user