diff options
author | Ray Chen <raychen@google.com> | 2010-03-12 11:30:27 -0800 |
---|---|---|
committer | Ray Chen <raychen@google.com> | 2010-03-12 13:58:01 -0800 |
commit | 76b3da43e488769ceaae0698e5e23cfde84b4ce2 (patch) | |
tree | 095efc3cceffd11fa147d82a41cf46e3bd391b0f /android/sqlite3_android.cpp | |
parent | 87ba5df965e08e3ad5cd3ad4ab3005cbc430429f (diff) |
Read external storage name from EXTERNAL_STORAGE variable.
Change-Id: I9d5bd02f23882dd85e91075e897150cafa33ffe5
Diffstat (limited to 'android/sqlite3_android.cpp')
-rw-r--r-- | android/sqlite3_android.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/android/sqlite3_android.cpp b/android/sqlite3_android.cpp index cdcc97b..a23d802 100644 --- a/android/sqlite3_android.cpp +++ b/android/sqlite3_android.cpp @@ -230,12 +230,13 @@ static void delete_file(sqlite3_context * context, int argc, sqlite3_value ** ar } char const * path = (char const *)sqlite3_value_text(argv[0]); - if (path == NULL) { + char const * external_storage = getenv("EXTERNAL_STORAGE"); + if (path == NULL || external_storage == NULL) { sqlite3_result_null(context); return; } - if (strncmp("/sdcard/", path, 8) != 0) { + if (strncmp(external_storage, path, strlen(external_storage)) != 0) { sqlite3_result_null(context); return; } |