src/stdlib/SDL_getenv.c
changeset 11678 1f10a52295e3
parent 11653 4130b92b6be4
child 11811 5d94cb6b24d3
     1.1 --- a/src/stdlib/SDL_getenv.c	Sat Nov 04 09:07:33 2017 -0700
     1.2 +++ b/src/stdlib/SDL_getenv.c	Sat Nov 04 09:37:29 2017 -0700
     1.3 @@ -171,23 +171,17 @@
     1.4  #endif
     1.5  
     1.6  /* Retrieve a variable named "name" from the environment */
     1.7 -#if defined(__ANDROID__)
     1.8 +#if defined(HAVE_GETENV)
     1.9  char *
    1.10  SDL_getenv(const char *name)
    1.11  {
    1.12 -    /* Input validation */
    1.13 -    if (!name || SDL_strlen(name)==0) {
    1.14 -        return NULL;
    1.15 -    }
    1.16 +#if defined(__ANDROID__)
    1.17 +    /* Make sure variables from the application manifest are available */
    1.18 +    Android_JNI_GetManifestEnvironmentVariables();
    1.19 +#endif
    1.20  
    1.21 -    return SDL_AndroidGetManifestEnvironmentVariable(name);    
    1.22 -}
    1.23 -#elif defined(HAVE_GETENV)
    1.24 -char *
    1.25 -SDL_getenv(const char *name)
    1.26 -{
    1.27      /* Input validation */
    1.28 -    if (!name || SDL_strlen(name)==0) {
    1.29 +    if (!name || !*name) {
    1.30          return NULL;
    1.31      }
    1.32