[vlc-commits] medialib: fs: device: Fix device removal
Hugo Beauzée-Luyssen
git at videolan.org
Mon Aug 24 13:27:53 CEST 2020
vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Thu Aug 20 17:17:35 2020 +0200| [dd497fd44bd23d5449222b36432a5ed5ae738a5a] | committer: Hugo Beauzée-Luyssen
medialib: fs: device: Fix device removal
It was lacking the same terminal '/' appending we do when a device gets
added, causing a mismatch depending on the SD module triggering the
removal
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=dd497fd44bd23d5449222b36432a5ed5ae738a5a
---
modules/misc/medialibrary/fs/device.cpp | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/modules/misc/medialibrary/fs/device.cpp b/modules/misc/medialibrary/fs/device.cpp
index 87227d4b5b..b1baa25389 100644
--- a/modules/misc/medialibrary/fs/device.cpp
+++ b/modules/misc/medialibrary/fs/device.cpp
@@ -92,8 +92,13 @@ void SDDevice::addMountpoint( std::string mrl )
}
}
-void SDDevice::removeMountpoint( const std::string& mrl )
+void SDDevice::removeMountpoint( const std::string& cmrl )
{
+ std::string mrl;
+ if ( *cmrl.crbegin() != '/' )
+ mrl = cmrl + '/';
+ else
+ mrl = cmrl;
auto it = std::find_if( begin( m_mountpoints ), end( m_mountpoints ),
[&mrl]( const Mountpoint& mp ) { return mp.mrl == mrl; } );
if ( it != end( m_mountpoints ) )
More information about the vlc-commits
mailing list