Skip to content

Commit

Permalink
Sony9pin: print port name without path
Browse files Browse the repository at this point in the history
Signed-off-by: Maxime Gervais <[email protected]>
  • Loading branch information
g-maxime committed Jul 8, 2023
1 parent 01f41e4 commit 9441414
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Source/Common/Sony9PinWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,11 @@ string Sony9PinWrapper::GetDeviceName(size_t DeviceIndex)
if (DeviceIndex >= Devices.size())
return "";

return Devices[DeviceIndex].port;
string name = Devices[DeviceIndex].port;
if (name.rfind("/dev/", 0) == 0)
name = name.substr(5);

return Devices[DeviceIndex].port + (name.empty() ? "" : (": " + name));
}

//---------------------------------------------------------------------------
Expand Down

0 comments on commit 9441414

Please sign in to comment.