src/filesystem/unix/SDL_sysfilesystem.c
changeset 7695 47d12c248988
parent 7694 7f965b1a24e0
child 7697 678f71df2c6b
     1.1 --- a/src/filesystem/unix/SDL_sysfilesystem.c	Fri Aug 23 23:34:23 2013 -0400
     1.2 +++ b/src/filesystem/unix/SDL_sysfilesystem.c	Sat Aug 24 09:05:18 2013 -0400
     1.3 @@ -173,7 +173,15 @@
     1.4              SDL_SetError("neither XDG_DATA_HOME nor HOME environment is set");
     1.5              return NULL;
     1.6          }
     1.7 -        append = ".local/share/";
     1.8 +        if (envr[SDL_strlen(envr) - 1] == '/') {
     1.9 +            append = ".local/share/";
    1.10 +        } else {
    1.11 +            append = "/.local/share/";
    1.12 +        }
    1.13 +    } else {
    1.14 +        if (envr[SDL_strlen(envr) - 1] == '/') {
    1.15 +            append = "";
    1.16 +        }
    1.17      } /* if */
    1.18  
    1.19      len = SDL_strlen(envr) + SDL_strlen(append) + SDL_strlen(app) + 2;