char *basePaths[ MAX_BASE_PATHS ];
int numGamePaths;
char *gamePaths[ MAX_GAME_PATHS ];
-
+char *homeBasePath = NULL;
/*
strcpy( installPath, "../" );
#else
char temp[ MAX_OS_PATH ];
+ char last0[ 2 ];
char *home;
char *path;
char *last;
/* do some path divining */
strcpy( temp, argv0 );
- if( strrchr( temp, '/' ) )
+ if( strrchr( argv0, '/' ) )
argv0 = strrchr( argv0, '/' ) + 1;
else
{
path = getenv( "PATH" );
/* minor setup */
+ last = last0;
last[ 0 ] = path[ 0 ];
last[ 1 ] = '\0';
found = qfalse;
return;
/* make a hole */
- for( i = 0; i < (MAX_BASE_PATHS - 1); i++ )
+ for( i = (MAX_BASE_PATHS - 2); i >= 0; i-- )
basePaths[ i + 1 ] = basePaths[ i ];
/* concatenate home dir and path */
argv[ i ] = NULL;
}
+ /* -fs_forbiddenpath */
+ else if( strcmp( argv[ i ], "-fs_forbiddenpath" ) == 0 )
+ {
+ if( ++i >= *argc )
+ Error( "Out of arguments: No path specified after %s.", argv[ i - 1 ] );
+ argv[ i - 1 ] = NULL;
+ if(g_numForbiddenDirs < VFS_MAXDIRS)
+ {
+ strncpy(g_strForbiddenDirs[g_numForbiddenDirs], argv[i], PATH_MAX);
+ g_strForbiddenDirs[g_numForbiddenDirs][PATH_MAX] = 0;
+ ++g_numForbiddenDirs;
+ }
+ argv[ i ] = NULL;
+ }
+
/* -fs_basepath */
else if( strcmp( argv[ i ], "-fs_basepath" ) == 0 )
{
AddGamePath( argv[ i ] );
argv[ i ] = NULL;
}
+
+ /* -fs_nohomebase */
+ else if( strcmp( argv[ i ], "-fs_homebase" ) == 0 )
+ {
+ if( ++i >= *argc )
+ Error( "Out of arguments: No path specified after %s.", argv[ i - 1 ] );
+ argv[ i - 1 ] = NULL;
+ homeBasePath = argv[i];
+ argv[ i ] = NULL;
+ }
}
/* remove processed arguments */
}
/* this only affects unix */
- AddHomeBasePath( game->homeBasePath );
+ if(homeBasePath)
+ AddHomeBasePath( homeBasePath );
+ else
+ AddHomeBasePath( game->homeBasePath );
/* initialize vfs paths */
if( numBasePaths > MAX_BASE_PATHS )