sdl12-compat: Corrected LoadSDL20Symbol().
authorRyan C. Gordon <icculus@icculus.org>
Wed, 06 Mar 2013 01:47:21 -0500
changeset 8e80b80267faa
parent 7 319d2c976902
child 9 408821d72ab2
sdl12-compat: Corrected LoadSDL20Symbol().
src/SDL_12_compat.c
     1.1 --- a/src/SDL_12_compat.c	Wed Mar 06 01:46:41 2013 -0500
     1.2 +++ b/src/SDL_12_compat.c	Wed Mar 06 01:47:21 2013 -0500
     1.3 @@ -254,9 +254,14 @@
     1.4  static void *
     1.5  LoadSDL20Symbol(const char *fn, int *okay)
     1.6  {
     1.7 -    if (!*okay)
     1.8 -        return NULL;  /* Already failed, so don't bother trying. */
     1.9 -    return LookupSDL20Sym(fn);
    1.10 +    void *retval = NULL;
    1.11 +    if (*okay)  /* only bother trying if we haven't previously failed. */
    1.12 +    {
    1.13 +        retval = LookupSDL20Sym(fn);
    1.14 +        if (retval == NULL)
    1.15 +            *okay = 0;
    1.16 +    }
    1.17 +    return retval;
    1.18  }
    1.19  
    1.20  static void