src/filesystem/unix/SDL_sysfilesystem.c
changeset 7695 47d12c248988
parent 7694 7f965b1a24e0
child 7697 678f71df2c6b
--- a/src/filesystem/unix/SDL_sysfilesystem.c	Fri Aug 23 23:34:23 2013 -0400
+++ b/src/filesystem/unix/SDL_sysfilesystem.c	Sat Aug 24 09:05:18 2013 -0400
@@ -173,7 +173,15 @@
             SDL_SetError("neither XDG_DATA_HOME nor HOME environment is set");
             return NULL;
         }
-        append = ".local/share/";
+        if (envr[SDL_strlen(envr) - 1] == '/') {
+            append = ".local/share/";
+        } else {
+            append = "/.local/share/";
+        }
+    } else {
+        if (envr[SDL_strlen(envr) - 1] == '/') {
+            append = "";
+        }
     } /* if */
 
     len = SDL_strlen(envr) + SDL_strlen(append) + SDL_strlen(app) + 2;