summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Carlstrom <bdc@google.com>2014-04-28 22:00:35 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-04-28 22:00:35 +0000
commit108ed9fa946ec516c0d853927c76ebbfca1dcb23 (patch)
tree154f1e08d9bd71a3c81b49d42ac8bb1aa71ceb8b
parent3f0d5669eb437ce1f9ce599e196d045534ec3d4f (diff)
parent0e8ae16f084e3d4772ea6dd33a9b72925d7b40d5 (diff)
downloadframeworks_native-108ed9fa946ec516c0d853927c76ebbfca1dcb23.zip
frameworks_native-108ed9fa946ec516c0d853927c76ebbfca1dcb23.tar.gz
frameworks_native-108ed9fa946ec516c0d853927c76ebbfca1dcb23.tar.bz2
Merge "Fix incorrect odex path handling"
-rw-r--r--cmds/installd/commands.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c
index 669f403..a86abe1 100644
--- a/cmds/installd/commands.c
+++ b/cmds/installd/commands.c
@@ -685,9 +685,13 @@ int dexopt(const char *apk_path, uid_t uid, int is_public,
/* Before anything else: is there a .odex file? If so, we have
* precompiled the apk and there is nothing to do here.
*/
- sprintf(out_path, "%s%s", apk_path, ".odex");
- if (stat(out_path, &dex_stat) == 0) {
- return 0;
+ strcpy(out_path, apk_path);
+ end = strrchr(out_path, '.');
+ if (end != NULL) {
+ strcpy(end, ".odex");
+ if (stat(out_path, &dex_stat) == 0) {
+ return 0;
+ }
}
if (create_cache_path(out_path, apk_path)) {