]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - fs.c
image: Sanitize paths on *all* images rather than images loaded from Q3 shaders
[xonotic/darkplaces.git] / fs.c
diff --git a/fs.c b/fs.c
index 87c5df4accacaa479f96ab0e2ebf5e4ca565fa84..182d05f3ef55eb04d624e15d72a43ea457095232 100644 (file)
--- a/fs.c
+++ b/fs.c
@@ -2507,6 +2507,24 @@ int FS_CheckNastyPath (const char *path, qbool isgamedir)
        return false;
 }
 
+/*
+====================
+FS_SanitizePath
+
+Sanitize path (replace non-portable characters 
+with portable ones in-place, etc)
+====================
+*/
+void FS_SanitizePath(char *path)
+{
+       int i, size;
+
+       for(i = 0, size = strlen(path); i < size; i++)
+       {
+               if(path[i] == '\\')
+                       path[i] = '/';
+       }
+}
 
 /*
 ====================