mirror of
https://github.com/libretro/RetroArch
synced 2025-04-11 00:44:20 +00:00
Fix loading of archived content with file names containing '#' characters
This commit is contained in:
parent
d8a5505204
commit
b5df2b883a
@ -90,12 +90,14 @@ const char *path_get_archive_delim(const char *path)
|
||||
if (!last_slash)
|
||||
return NULL;
|
||||
|
||||
/* Find delimiter position */
|
||||
delim = strrchr(last_slash, '#');
|
||||
|
||||
if (!delim)
|
||||
return NULL;
|
||||
/* Find delimiter position
|
||||
* > Since filenames may contain '#' characters,
|
||||
* must loop until we find the first '#' that
|
||||
* is directly *after* a compression extension */
|
||||
delim = strchr(last_slash, '#');
|
||||
|
||||
while (delim)
|
||||
{
|
||||
/* Check whether this is a known archive type
|
||||
* > Note: The code duplication here is
|
||||
* deliberate, to maximise performance */
|
||||
@ -124,6 +126,10 @@ const char *path_get_archive_delim(const char *path)
|
||||
return delim;
|
||||
}
|
||||
|
||||
delim++;
|
||||
delim = strchr(delim, '#');
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user