Fledge68 / WiiFlow_Lite

My mod of the Wii USB Loader WiiFlow
459 stars 58 forks source link

File types filter may not work due to '|' at the end of configuration value #328

Closed eku closed 1 year ago

eku commented 1 year ago

Describe the bug The function stringToVector is used, for example, to split parameters in the configuration files of the plug-ins.

If, as happens e.g. with some plugins, the string is terminated with a separator |, the function returns an empty string as the last element in the vector.

Since an empty string matches all when comparing with file extensions, it no longer acts as a filter,

To Reproduce Steps to reproduce the behavior:

  1. Edit for example WonderSwan/WonderSwan_mednafen_libretro.ini
  2. Change line filetypes=.ws|.zip|
  3. Place files with any extensions in the directory pointed to by romdir.
  4. Go to WonderSwan and press Refresh cache
  5. WFL shows all files as games

What version of WiiFlow Lite v5.5.3

On Wii or Wii U vWii Wii

Screenshots n.a.

Additional context Of course, you can fix the error in the plugin configuration, but most users don't realise this if the file already comes in wrong. WFL could be more tolerant.

Probably stringToVector should test the length of the extracted substring and skip empty strings rather then pushing it to the vector.