commit 6f073935facc78af54fe8c9d8f3ab1e4705a0d53
parent c09c73551618b5cc2322b4d7065639b1aa05f6e0
Author: fundamental <mark.d.mccurry@gmail.com>
Date: Mon, 1 Aug 2016 10:30:24 -0400
Add Workaround For Windows Home Dir Paths
Diffstat:
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/Misc/MiddleWare.cpp b/src/Misc/MiddleWare.cpp
@@ -1198,7 +1198,14 @@ static rtosc::Ports middwareSnoopPorts = {
rEnd},
{"file_home_dir:", 0, 0,
rBegin;
- d.reply(d.loc, "s", getenv("HOME"));
+ const char *home = getenv("HOME");
+ if(!home)
+ home = getenv("USERPROFILE");
+ if(!home)
+ home = getenv("HOMEPATH");
+ if(!home)
+ home = "/";
+ d.reply(d.loc, "s", home);
rEnd},
{"file_list_files:s", 0, 0,
rBegin;