Skip to content

Commit 33c1b78

Browse files
committed
Clean up Unix code a bit
1 parent 5265627 commit 33c1b78

File tree

1 file changed

+4
-18
lines changed

1 file changed

+4
-18
lines changed

code/cfile/cfilesystem.cpp

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -557,10 +557,6 @@ void cf_search_root_path(int root_index)
557557
mprintf(( "Searching root '%s' ... ", root->path ));
558558

559559
char search_path[CF_MAX_PATHNAME_LENGTH];
560-
#ifdef SCP_UNIX
561-
// This map stores the mapping between a specific path type and the actual path that we use for it
562-
SCP_unordered_map<int, SCP_string> pathTypeToRealPath;
563-
#endif
564560

565561
for (i=CF_TYPE_ROOT; i<CF_MAX_PATH_TYPES; i++ ) {
566562

@@ -680,20 +676,10 @@ void cf_search_root_path(int root_index)
680676
// On Unix we can have a different case for the search paths so we also need to account for that
681677
// We do that by looking at the parent of search_path and enumerating all directories and then check if any of
682678
// them are a case-insensitive match
683-
SCP_string directory_name;
684-
685-
auto parentPathIter = pathTypeToRealPath.find(Pathtypes[i].parent_index);
686-
687-
// if (parentPathIter == pathTypeToRealPath.end()) {
688-
// No parent known yet, use the standard dirname
689-
char dirname_copy[CF_MAX_PATHNAME_LENGTH];
690-
memcpy(dirname_copy, search_path, sizeof(search_path));
691-
// According to the documentation of directory_name and basename, the return value does not need to be freed
692-
directory_name.assign(dirname(dirname_copy));
693-
// } else {
694-
// // we have a valid parent path -> use that
695-
// directory_name = parentPathIter->second;
696-
// }
679+
char dirname_copy[CF_MAX_PATHNAME_LENGTH];
680+
memcpy(dirname_copy, search_path, sizeof(search_path));
681+
// According to the documentation of directory_name and basename, the return value does not need to be freed
682+
auto directory_name = dirname(dirname_copy);
697683

698684
char basename_copy[CF_MAX_PATHNAME_LENGTH];
699685
memcpy(basename_copy, search_path, sizeof(search_path));

0 commit comments

Comments
 (0)