diff options
author | David 'Digit' Turner <digit@android.com> | 2011-05-04 22:59:26 +0200 |
---|---|---|
committer | Raphael Moll <ralf@android.com> | 2011-05-04 14:39:26 -0700 |
commit | 83bc92d90df040916d26d5ab9cd7c753939f51b0 (patch) | |
tree | 2a04b4d6238f0f6d5f554ddba9b37d84c4d1d0bf | |
parent | d0f48c07a5bc47fb461aa5dc4e41e8d6798c8ccc (diff) | |
download | external_qemu-83bc92d90df040916d26d5ab9cd7c753939f51b0.zip external_qemu-83bc92d90df040916d26d5ab9cd7c753939f51b0.tar.gz external_qemu-83bc92d90df040916d26d5ab9cd7c753939f51b0.tar.bz2 |
Merge "Fix ANDROID_SDK_HOME handling."
A previous patch introducing the "emulator" launcher program
did regress the way ANDROID_SDK_HOME is parsed. Fix that by
actually trusting bufprint_config_path() to always do the right
thing :-)
(Merged from original id: I11a13fea95727ee9c487595fd4ae5e81805986da)
Change-Id: I999de28a1cba530bc48e4219e5586ae20d80127b
-rw-r--r-- | android/avd/util.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/android/avd/util.c b/android/avd/util.c index fdeb0fe..2ba4117 100644 --- a/android/avd/util.c +++ b/android/avd/util.c @@ -100,19 +100,12 @@ path_getRootIniPath( const char* avdName ) char* path_getSdkHome(void) { - const char* sdkHome = getenv("ANDROID_SDK_HOME"); - - if (sdkHome == NULL || *sdkHome == '\0') { - char temp[PATH_MAX], *p=temp, *end=p+sizeof(temp); - p = bufprint_config_path(temp, end); - if (p >= end) { - APANIC("User path too long!: %s\n", temp); - } - sdkHome = strdup(temp); - } else { - sdkHome = strdup(sdkHome); + char temp[PATH_MAX], *p=temp, *end=p+sizeof(temp); + p = bufprint_config_path(temp, end); + if (p >= end) { + APANIC("User path too long!: %s\n", temp); } - return (char*)sdkHome; + return strdup(temp); } |