Calling Sys_Dirname on argv[0] lead to slashes in argv[0] getting overwritten on Linux (and potentially other non-Windows platforms), causing some external script to fail sending signals to the right process, because the path changed.
This pull request adjusts Sys_Dirname and Sys_Basename to work with a copy of the given string instead of the original. This makes the behavior of both functions more consistent between Windows and other platforms.
Calling
Sys_Dirname
onargv[0]
lead to slashes inargv[0]
getting overwritten on Linux (and potentially other non-Windows platforms), causing some external script to fail sending signals to the right process, because the path changed.This pull request adjusts
Sys_Dirname
andSys_Basename
to work with a copy of the given string instead of the original. This makes the behavior of both functions more consistent between Windows and other platforms.