chdir was in the wrong place
@@ -516,6 +516,7 @@ int main(int argc, char* args[])
}
}
+ chdir(base);
if (engine.tar != NULL) {
// It is a tar file, we need to look for a "main.wren" entry point.
strcpy(pathBuf, mainFileName);
@@ -523,7 +524,6 @@ int main(int argc, char* args[])
// Not a tar file, use the given path or main.wren
strcpy(pathBuf, base);
strcat(pathBuf, !autoResolve ? fileName : mainFileName);
- chdir(base);
engine.argv[1] = strdup(pathBuf);
strcpy(pathBuf, !autoResolve ? fileName : mainFileName);
}
