Skip to content

Commit c15f557

Browse files
Disk(Linux): Use mountpoint as last fallback for disk name
1 parent 7edc715 commit c15f557

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Features:
2828
* Optimise font module printing (Windows)
2929
* Detect pacman package count inside MSYS2 environment (Windows)
3030
* Add Wifi / Battery module support for Android
31+
* Disk name support for Linux
3132

3233
Logos:
3334
* Raspbian (@IamNoRobot, #373)

src/detection/disk/disk_linux.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ static void detectName(FFDisk* disk, const FFstrbuf* device)
116116
detectNameFromPath(disk, &deviceStat, &basePath);
117117
}
118118

119+
//Use the mountpoint as a last resort
120+
if(disk->name.length == 0)
121+
ffStrbufAppend(&disk->name, &disk->mountpoint);
122+
119123
ffStrbufDestroy(&basePath);
120124
}
121125

0 commit comments

Comments
 (0)