Created
January 10, 2018 04:05
-
-
Save cigumo/2df45bd2199cc4357a0348376fc3ff26 to your computer and use it in GitHub Desktop.
[PATCH] changes SDL_AndroidGetInternalStoragePath to return a canonical path
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/love/src/jni/SDL2-2.0.5/src/core/android/SDL_android.c b/love/src/jni/SDL2-2.0.5/src/core/android/SDL_android.c | |
index b93b1625..e11fe3c5 100644 | |
--- a/love/src/jni/SDL2-2.0.5/src/core/android/SDL_android.c | |
+++ b/love/src/jni/SDL2-2.0.5/src/core/android/SDL_android.c | |
@@ -1665,10 +1665,14 @@ const char * SDL_AndroidGetInternalStoragePath() | |
return NULL; | |
} | |
- /* path = fileObject.getAbsolutePath(); */ | |
+ /* path = fileObject.getCanonicalPath(); */ | |
mid = (*env)->GetMethodID(env, (*env)->GetObjectClass(env, fileObject), | |
- "getAbsolutePath", "()Ljava/lang/String;"); | |
+ "getCanonicalPath", "()Ljava/lang/String;"); | |
pathString = (jstring)(*env)->CallObjectMethod(env, fileObject, mid); | |
+ if (Android_JNI_ExceptionOccurred(SDL_FALSE)) { | |
+ LocalReferenceHolder_Cleanup(&refs); | |
+ return NULL; | |
+ } | |
path = (*env)->GetStringUTFChars(env, pathString, NULL); | |
s_AndroidInternalFilesPath = SDL_strdup(path); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment