Skip to content

Commit

Permalink
Packages (Linux): fix snap package number detection on systems other …
Browse files Browse the repository at this point in the history
…than Ubuntu

Fixes 562
  • Loading branch information
CarterLi committed Sep 20, 2023
1 parent 576fcd7 commit 5337e5c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Bugfixes:
* Fix Termux Monet terminal version detection (Terminal)
* Fix zpool volumes detection (Disk, Linux)
* Fix external volumes detection (Disk, Linux)
* Fix snap package number detection on systems other than Ubuntu (Packages, Linux)

Logo:
* Add Afterglow
Expand Down
3 changes: 3 additions & 0 deletions src/detection/packages/packages_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ static uint32_t getSnap(FFstrbuf* baseDir)
{
uint32_t result = getNumElements(baseDir, "/snap", DT_DIR);

if (result == 0)
result = getNumElements(baseDir, "/var/lib/snapd/snap", DT_DIR);

//Accounting for the /snap/bin folder
return result > 0 ? result - 1 : 0;
}
Expand Down

0 comments on commit 5337e5c

Please sign in to comment.