From 76b3da43e488769ceaae0698e5e23cfde84b4ce2 Mon Sep 17 00:00:00 2001 From: Ray Chen Date: Fri, 12 Mar 2010 11:30:27 -0800 Subject: Read external storage name from EXTERNAL_STORAGE variable. Change-Id: I9d5bd02f23882dd85e91075e897150cafa33ffe5 --- android/sqlite3_android.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'android/sqlite3_android.cpp') 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; } -- cgit v1.2.3