From 83bc92d90df040916d26d5ab9cd7c753939f51b0 Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Wed, 4 May 2011 22:59:26 +0200 Subject: 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 --- android/avd/util.c | 17 +++++------------ 1 file 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); } -- cgit v1.1