summaryrefslogtreecommitdiff
path: root/src/qcommon
diff options
context:
space:
mode:
Diffstat (limited to 'src/qcommon')
-rw-r--r--src/qcommon/files.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/qcommon/files.c b/src/qcommon/files.c
index 4edf0318..5ab6e980 100644
--- a/src/qcommon/files.c
+++ b/src/qcommon/files.c
@@ -509,13 +509,12 @@ qboolean FS_CreatePath (char *OSPath) {
Q_strncpyz( path, OSPath, sizeof( path ) );
FS_ReplaceSeparators( path );
- // Skip creation of the root directory as it will always be there
- ofs = strchr( path, PATH_SEP );
- if ( ofs != NULL ) {
+ ofs = path;
+ while ( *ofs == PATH_SEP ) {
ofs++;
}
- for (; ofs != NULL && *ofs ; ofs++) {
+ for ( ; *ofs ; ofs++) {
if (*ofs == PATH_SEP) {
// create the directory
*ofs = 0;
@@ -524,6 +523,9 @@ qboolean FS_CreatePath (char *OSPath) {
path );
}
*ofs = PATH_SEP;
+ while ( *(ofs + 1) == PATH_SEP ) {
+ ofs++;
+ }
}
}