1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-25 07:44:38 +01:00

Refactor uses of path_append_extension

This commit is contained in:
Silent
2022-03-10 00:12:05 +01:00
parent 0f2cf23318
commit 3773fa4cb0
5 changed files with 52 additions and 53 deletions

View File

@@ -62,20 +62,6 @@ bool filename_valid_characters(const utf8* filename)
return true;
}
void path_append_extension(utf8* path, const utf8* newExtension, size_t size)
{
// Skip to the dot if the extension starts with a pattern (starts with "*.")
if (newExtension[0] == '*')
newExtension++;
// Append a dot to the filename if the new extension doesn't start with it
if (newExtension[0] != '.')
safe_strcat(path, ".", size);
// Append the extension to the path
safe_strcat(path, newExtension, size);
}
void path_end_with_separator(utf8* path, size_t size)
{
size_t length = strnlen(path, size);