Skip to content

Commit 8109241

Browse files
author
Risto Toijala
committed
unix mods: use "." instead of full cwd path to avoid error condition
1 parent 947deb8 commit 8109241

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

code/cmdline/cmdline.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,17 +1094,11 @@ static SCP_vector<SCP_string> unix_get_dir_names(SCP_string parent, SCP_string d
10941094
// For case sensitive filesystems (e.g. Linux/BSD) perform case-insensitive dir matches.
10951095
static void handle_unix_modlist(char **modlist, int *len)
10961096
{
1097-
char cur_dir[CF_MAX_PATHNAME_LENGTH];
1098-
1099-
if ( !_getcwd(cur_dir, CF_MAX_PATHNAME_LENGTH ) ) {
1100-
Error(LOCATION, "Can't get current working directory -- %d", errno );
1101-
}
1102-
11031097
// search filesystem for given paths
11041098
SCP_vector<SCP_string> mod_paths;
11051099
for (char *cur_mod = strtok(*modlist, ","); cur_mod != NULL; cur_mod = strtok(NULL, ","))
11061100
{
1107-
SCP_vector<SCP_string> this_mod_paths = unix_get_dir_names(cur_dir, cur_mod);
1101+
SCP_vector<SCP_string> this_mod_paths = unix_get_dir_names(".", cur_mod);
11081102
if (this_mod_paths.empty()) {
11091103
ReleaseWarning(LOCATION, "Can't find mod '%s'", cur_mod);
11101104
}

0 commit comments

Comments
 (0)