summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJari Vetoniemi <mailroxas@gmail.com>2018-11-19 15:16:28 +0200
committerJari Vetoniemi <mailroxas@gmail.com>2018-11-19 15:16:28 +0200
commitf6683c532bd556111683e8a380a8304a9a8775ea (patch)
treeef9610f4649f9ae00acbc23c69b13c463af81ed9
parentfdd1793f316e9f7f69c15862a04ec05de59cb15e (diff)
loader: fix obb injection
-rw-r--r--src/loader.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/loader.c b/src/loader.c
index 8706f23..02dce84 100644
--- a/src/loader.c
+++ b/src/loader.c
@@ -1,6 +1,7 @@
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
+#include <string.h>
#include <dirent.h>
#include <libgen.h>
#include <dlfcn.h>
@@ -132,6 +133,9 @@ run_jni_game(struct jvm *jvm)
const char *obb_dir = getenv("ANDROID_EXTERNAL_OBB_DIR");
if (obb_dir && (dir = opendir(obb_dir))) {
for (struct dirent *d; (d = readdir(dir));) {
+ if (!strcmp(d->d_name, ".") || !strcmp(d->d_name, ".."))
+ continue;
+
char path[4096];
snprintf(path, sizeof(path), "%s/%s", obb_dir, d->d_name);
unity.native_file.fun(&jvm->env, context, jvm->env->NewStringUTF(&jvm->env, path));