Fix infinite recursion on android getting environment variables

* We changed all uses of getenv to our Process::GetEnvironmentVariable in
  a1422df, but on android this causes an infinite recursion because its
  implementation of GetEnvironmentVariable uses LaunchProcess to query for the
  variable, which then tries to look up the PATH variable (which does not exist
  on android).
This commit is contained in:
baldurk
2023-05-04 17:28:01 +01:00
parent 9e93154383
commit 8fe6c209f8
5 changed files with 24 additions and 1 deletions
@@ -85,6 +85,11 @@ rdcstr GetAppFolderFilename(const rdcstr &filename)
return GetTempRootPath() + rdcstr("/") + filename;
}
rdcstr FindFileInPath(const rdcstr &fileName)
{
return fileName;
}
// For RenderDoc's apk, this returns our package name
// For other APKs, we use it to get the writable temp directory.
void GetExecutableFilename(rdcstr &selfName)
@@ -159,6 +159,12 @@ rdcstr GetAppFolderFilename(const rdcstr &filename)
return ret + filename;
}
rdcstr DefaultFindFileInPath(const rdcstr &fileName);
rdcstr FindFileInPath(const rdcstr &fileName)
{
return DefaultFindFileInPath(fileName);
}
void GetExecutableFilename(rdcstr &selfName)
{
char path[512] = {0};
+6
View File
@@ -92,6 +92,12 @@ rdcstr GetAppFolderFilename(const rdcstr &filename)
return ret + filename;
}
rdcstr DefaultFindFileInPath(const rdcstr &fileName);
rdcstr FindFileInPath(const rdcstr &fileName)
{
return DefaultFindFileInPath(fileName);
}
void GetExecutableFilename(rdcstr &selfName)
{
char path[512] = {0};
@@ -614,6 +614,12 @@ rdcstr GetAppFolderFilename(const rdcstr &filename)
return ret + filename;
}
rdcstr DefaultFindFileInPath(const rdcstr &fileName);
rdcstr FindFileInPath(const rdcstr &fileName)
{
return DefaultFindFileInPath(fileName);
}
void GetExecutableFilename(rdcstr &selfName)
{
char path[512] = {0};
+1 -1
View File
@@ -101,7 +101,7 @@ rdcstr GetFullPathname(const rdcstr &filename)
return rdcstr(path);
}
rdcstr FindFileInPath(const rdcstr &fileName)
rdcstr DefaultFindFileInPath(const rdcstr &fileName)
{
rdcstr filePath;