am 58ea37fe: am 108ed9fa: Merge "Fix incorrect odex path handling"

* commit '58ea37fe26fc733db478e606374f08d8a9d070cc':
  Fix incorrect odex path handling
This commit is contained in:
Brian Carlstrom 2014-04-28 22:10:01 +00:00 committed by Android Git Automerger
commit aaa22fd38c

View File

@ -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 /* Before anything else: is there a .odex file? If so, we have
* precompiled the apk and there is nothing to do here. * precompiled the apk and there is nothing to do here.
*/ */
sprintf(out_path, "%s%s", apk_path, ".odex"); strcpy(out_path, apk_path);
if (stat(out_path, &dex_stat) == 0) { end = strrchr(out_path, '.');
return 0; if (end != NULL) {
strcpy(end, ".odex");
if (stat(out_path, &dex_stat) == 0) {
return 0;
}
} }
if (create_cache_path(out_path, apk_path)) { if (create_cache_path(out_path, apk_path)) {