Merge pull request #1671 from DAD-Grid/android-wrapper

Fixed wrapper execution time error in android
This commit is contained in:
David Anderson 2016-11-25 02:41:03 -08:00 committed by GitHub
commit 48f1720085
1 changed files with 3 additions and 2 deletions

View File

@ -306,9 +306,10 @@ void macro_substitute(string &str) {
fprintf(stderr, "[DEBUG] replacing '%s' with '%s'\n", "$PWD", nt);
#endif
#else
str_replace_all(str, "$PWD", getenv("PWD"));
char cwd[1024];
str_replace_all(str, "$PWD", getcwd(cwd, sizeof(cwd)));
#ifdef DEBUG
fprintf(stderr, "[DEBUG] replacing '%s' with '%s'\n", "$PWD", getenv("PWD"));
fprintf(stderr, "[DEBUG] replacing '%s' with '%s'\n", "$PWD", getcwd(cwd, sizeof(cwd)));
#endif
#endif
}