From 8a3f25311b3c04ae7baef616fd0630bc65401d58 Mon Sep 17 00:00:00 2001 From: hizzlekizzle Date: Mon, 6 Jan 2025 18:58:53 -0600 Subject: [PATCH] partial revert of c09fd38 (#17363) which was causing softpatching to break on games with periods/dots in the filename. This restores the previous patch-matching behavior --- runloop.c | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/runloop.c b/runloop.c index 80c8891cce7..0f34c0bec2d 100644 --- a/runloop.c +++ b/runloop.c @@ -4849,28 +4849,44 @@ void runloop_path_fill_names(void) return; if (string_is_empty(runloop_st->name.ups)) - fill_pathname(runloop_st->name.ups, + { + size_t len = strlcpy(runloop_st->name.ups, runloop_st->runtime_content_path_basename, - ".ups", sizeof(runloop_st->name.ups)); + strlcpy(runloop_st->name.ups + len, + ".ups", + sizeof(runloop_st->name.ups) - len); + } if (string_is_empty(runloop_st->name.bps)) - fill_pathname(runloop_st->name.bps, + { + size_t len = strlcpy(runloop_st->name.bps, runloop_st->runtime_content_path_basename, - ".bps", sizeof(runloop_st->name.bps)); + strlcpy(runloop_st->name.bps + len, + ".bps", + sizeof(runloop_st->name.bps) - len); + } if (string_is_empty(runloop_st->name.ips)) - fill_pathname(runloop_st->name.ips, + { + size_t len = strlcpy(runloop_st->name.ips, runloop_st->runtime_content_path_basename, - ".ips", sizeof(runloop_st->name.ips)); + strlcpy(runloop_st->name.ips + len, + ".ips", + sizeof(runloop_st->name.ips) - len); + } if (string_is_empty(runloop_st->name.xdelta)) - fill_pathname(runloop_st->name.xdelta, + { + size_t len = strlcpy(runloop_st->name.xdelta, runloop_st->runtime_content_path_basename, - ".xdelta", sizeof(runloop_st->name.xdelta)); + strlcpy(runloop_st->name.xdelta + len, + ".xdelta", + sizeof(runloop_st->name.xdelta) - len); + } }