Skip to content

Commit

Permalink
Fix public github #810
Browse files Browse the repository at this point in the history
  • Loading branch information
ogbrugge-work authored and rdementi committed Aug 13, 2024
1 parent a3e671a commit 68f3d92
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/lspci.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
" https://raw.githubusercontent.com/pciutils/pciids/master/pci.ids and" \
" copy it to the current directory."
#else
// different distributions put it in different places
#define PCI_IDS_PATH "/usr/share/hwdata/pci.ids"
#define PCI_IDS_PATH2 "/usr/share/misc/pci.ids"
#define PCI_IDS_NOT_FOUND "/usr/share/hwdata/pci.ids file is not available." \
" Ensure that the \"hwdata\" package is properly installed or download" \
" https://raw.githubusercontent.com/pciutils/pciids/master/pci.ids and" \
Expand Down Expand Up @@ -448,6 +450,12 @@ void load_PCIDB(PCIDB & pciDB)
if (!in.is_open())
{
#ifndef _MSC_VER
// On Unix, try PCI_IDS_PATH2
in.open(PCI_IDS_PATH2);
}

if (!in.is_open())
{
// On Unix, try the current directory if the default path failed
in.open("pci.ids");
}
Expand Down

0 comments on commit 68f3d92

Please sign in to comment.