mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-12 01:30:49 +01:00
Support extensionless in swap_extension
This commit is contained in:
parent
474c15723a
commit
c58b1650c9
@ -9,11 +9,18 @@ static void swap_extension(char* pathname, /*size_t*/ int pathname_len, const ch
|
||||
char* extension = (char*)filename_extension(pathname);
|
||||
//todo safeops
|
||||
if (extension[0] == '\0') {
|
||||
if (swap[0] != '\0') {
|
||||
strcat(pathname, ".");
|
||||
strcat(pathname, swap);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (swap[0] != '\0') {
|
||||
strcpy(extension, swap);
|
||||
} else {
|
||||
extension--;
|
||||
extension[0] = '\0';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user