ft2-clone

Fasttracker 2 clone
Log | Files | Refs | README | LICENSE

commit df3896f54b44385c80694c8f7504716ec18d9bff
parent a56e333a3570f382c449f6e6a2f17fc0c8c23a3c
Author: Olav Sørensen <olav.sorensen@live.no>
Date:   Mon,  3 Oct 2022 16:23:31 +0200

Default Disk Op. dir = desktop

Diffstat:
Msrc/ft2_diskop.c | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/ft2_diskop.c b/src/ft2_diskop.c @@ -2251,13 +2251,18 @@ void showDiskOpScreen(void) // first test if we can change the dir to the one stored in the config (if present) if (FReq_ModCurPathU[0] == '\0' || UNICHAR_CHDIR(FReq_ModCurPathU) != 0) { - // nope, couldn't do that, set Disk Op. path to user/home directory + // nope, couldn't do that, set Disk Op. path to the user's desktop directory #ifdef _WIN32 SHGetFolderPathW(NULL, CSIDL_DESKTOPDIRECTORY, NULL, 0, FReq_ModCurPathU); #else char *home = getenv("HOME"); if (home != NULL) + { + UNICHAR_CHDIR(home); UNICHAR_STRCPY(FReq_ModCurPathU, home); + + UNICHAR_STRCAT(FReq_ModCurPathU, "/Desktop"); + } #endif UNICHAR_CHDIR(FReq_ModCurPathU); }