Skip to content

Commit ad2f6ce

Browse files
committed
ps2: normalize CWD to work around PS2SDK bug
Workaround for PS2SDK issue ps2dev/ps2sdk#805. PS2SDK's initialization routine does not properly set the CWD for HDD paths, leading to all slashes being converted to backslashes. This change ensures that they are converted back to slashes, until the issue is properly fixed in PS2SDK.
1 parent b2afc9f commit ad2f6ce

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

frontend/drivers/platform_ps2.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,14 @@ static void common_init_drivers(bool extra_drivers)
306306
poweroffSetCallback(&poweroffHandler, NULL);
307307

308308
getcwd(cwd, sizeof(cwd));
309+
310+
// Workaround for PS2SDK issue: https://github.com/ps2dev/ps2sdk/issues/805
311+
// PS2SDK's initialization routine does not properly set the CWD for HDD
312+
// paths, leading to all slashes being converted to backslashes. Manually
313+
// convert them back to slashes to work around the issue until it is
314+
// properly fixed in PS2SDK.
315+
pathname_conform_slashes_to_os(cwd);
316+
309317
#if !defined(IS_SALAMANDER) && !defined(DEBUG)
310318
/* If it is not Salamander, we need to go one level
311319
* up for setting the CWD. */

0 commit comments

Comments
 (0)