diff options
author | Brian Carlstrom <bdc@google.com> | 2014-04-28 22:06:09 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-04-28 22:06:09 +0000 |
commit | 58ea37fe26fc733db478e606374f08d8a9d070cc (patch) | |
tree | 5402e081244dac3c12be8d634581f46a8c546973 | |
parent | bba1385d1cfdbe80d7e5f441d943edd4c5708eca (diff) | |
parent | 108ed9fa946ec516c0d853927c76ebbfca1dcb23 (diff) | |
download | frameworks_native-58ea37fe26fc733db478e606374f08d8a9d070cc.zip frameworks_native-58ea37fe26fc733db478e606374f08d8a9d070cc.tar.gz frameworks_native-58ea37fe26fc733db478e606374f08d8a9d070cc.tar.bz2 |
am 108ed9fa: Merge "Fix incorrect odex path handling"
* commit '108ed9fa946ec516c0d853927c76ebbfca1dcb23':
Fix incorrect odex path handling
-rw-r--r-- | cmds/installd/commands.c | 10 |
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)) { |