music.c
changeset 762 6c6adcc85536
parent 757 420f3b37dc95
child 766 1e215d1f9492
     1.1 --- a/music.c	Thu Oct 12 22:57:17 2017 -0700
     1.2 +++ b/music.c	Thu Oct 12 23:05:15 2017 -0700
     1.3 @@ -1633,6 +1633,7 @@
     1.4  {
     1.5      char *context, *path, *paths;
     1.6      const char* cpaths = Mix_GetSoundFonts();
     1.7 +    int soundfonts_found = 0;
     1.8  
     1.9      if (!cpaths) {
    1.10          Mix_SetError("No SoundFonts have been requested");
    1.11 @@ -1652,12 +1653,16 @@
    1.12      for (path = strtok_r(paths, ":;", &context); path; path = strtok_r(NULL, ":;", &context)) {
    1.13  #endif
    1.14          if (!function(path, data)) {
    1.15 -            SDL_free(paths);
    1.16 -            return 0;
    1.17 +            continue;
    1.18 +        } else {
    1.19 +            soundfonts_found++;
    1.20          }
    1.21      }
    1.22  
    1.23      SDL_free(paths);
    1.24 -    return 1;
    1.25 +    if (soundfonts_found > 0)
    1.26 +        return 1;
    1.27 +    else
    1.28 +        return 0;
    1.29  }
    1.30  #endif