src/joystick/linux/SDL_sysjoystick.c
changeset 6865 670ebd20759d
parent 6852 424a6a791947
child 6885 700f1b25f77f
     1.1 --- a/src/joystick/linux/SDL_sysjoystick.c	Tue Feb 12 13:59:04 2013 -0300
     1.2 +++ b/src/joystick/linux/SDL_sysjoystick.c	Tue Feb 12 11:47:29 2013 -0800
     1.3 @@ -339,13 +339,12 @@
     1.4              }
     1.5              if (prev != NULL) {
     1.6                  prev->next = item->next;
     1.7 -                if (item == SDL_joylist_tail) {
     1.8 -                    SDL_joylist_tail = prev;
     1.9 -                }
    1.10              } else {
    1.11 -                SDL_assert(!SDL_joylist);
    1.12 -                SDL_assert(!SDL_joylist_tail);
    1.13 -                SDL_joylist = SDL_joylist_tail = NULL;
    1.14 +                SDL_assert(SDL_joylist == item);
    1.15 +                SDL_joylist = item->next;
    1.16 +            }
    1.17 +            if (item == SDL_joylist_tail) {
    1.18 +                SDL_joylist_tail = prev;
    1.19              }
    1.20              SDL_free(item->path);
    1.21              SDL_free(item->name);