File tree Expand file tree Collapse file tree 2 files changed +2
-7
lines changed
common/lib/kernel/devices Expand file tree Collapse file tree 2 files changed +2
-7
lines changed Original file line number Diff line number Diff line change @@ -41,9 +41,7 @@ size_t IpDevice::addr() const {
4141}
4242
4343bool IpDevice::is_path_valid (const std::filesystem::path unsafe_path) {
44- // Split the string at last slash
45- int pos = unsafe_path.u8string ().rfind (' /' );
46- std::string assumed_device_name = unsafe_path.u8string ().substr (pos + 1 );
44+ std::string assumed_device_name = unsafe_path.filename ();
4745
4846 // Match format of hexaddr.devicename
4947 if (!std::regex_match (assumed_device_name,
Original file line number Diff line number Diff line change @@ -48,7 +48,4 @@ std::filesystem::path PlatformDevice::override_path() const {
4848 return this ->m_override_path ;
4949}
5050
51- std::string PlatformDevice::name () const {
52- size_t pos = this ->m_path .u8string ().rfind (' /' );
53- return this ->m_path .u8string ().substr (pos + 1 );
54- }
51+ std::string PlatformDevice::name () const { return this ->m_path .filename (); }
You can’t perform that action at this time.
0 commit comments