@@ -1039,15 +1039,13 @@ char *cmdline_parm::str()
10391039#ifdef SCP_UNIX
10401040// Return a vector with all filesystem names of "parent/dir" relative to parent.
10411041// dir must not contain a slash.
1042- static SCP_vector<SCP_string> unix_get_single_dir_names (SCP_string dir , SCP_string parent )
1042+ static SCP_vector<SCP_string> unix_get_single_dir_names (SCP_string parent , SCP_string dir )
10431043{
10441044 DIR *dp;
10451045 if ((dp = opendir (parent.c_str ())) == NULL ) {
10461046 Error (LOCATION, " Can't open directory '%s' -- %d" , parent.c_str (), errno);
10471047 }
10481048
1049- SCP_vector<SCP_string> ret;
1050-
10511049 dirent *dirp;
10521050 while ((dirp = readdir (dp)) != NULL ) {
10531051 if (!stricmp (dirp->d_name , dir.c_str ())) {
@@ -1061,17 +1059,17 @@ static SCP_vector<SCP_string> unix_get_single_dir_names(SCP_string dir, SCP_stri
10611059
10621060// Return a vector with all filesystem names of "parent/dir" relative to parent.
10631061// Recurses to deal with slashes in dir.
1064- static SCP_vector<SCP_string> unix_get_dir_names (SCP_string dir , SCP_string parent )
1062+ static SCP_vector<SCP_string> unix_get_dir_names (SCP_string parent , SCP_string dir )
10651063{
10661064 size_t slash = dir.find_first_of (" /\\ " );
10671065
10681066 // no subdirectories, no need to recurse
10691067 if (slash == std::string::npos) {
1070- return unix_get_single_dir_names (dir, parent );
1068+ return unix_get_single_dir_names (parent, dir );
10711069 }
10721070
10731071 // get the names of the first component of dir
1074- SCP_vector<SCP_string> this_dir_names = unix_get_single_dir_names (dir.substr (0 , slash), parent );
1072+ SCP_vector<SCP_string> this_dir_names = unix_get_single_dir_names (parent, dir.substr (0 , slash));
10751073
10761074 SCP_string rest = dir.substr (slash + 1 );
10771075
@@ -1081,7 +1079,7 @@ static SCP_vector<SCP_string> unix_get_dir_names(SCP_string dir, SCP_string pare
10811079 SCP_vector<SCP_string>::iterator ii, end = this_dir_names.end ();
10821080 for (ii = this_dir_names.begin (); ii != end; ++ii) {
10831081 SCP_string this_dir_path = parent + " /" + *ii;
1084- SCP_vector<SCP_string> mod_path = unix_get_dir_names (rest, this_dir_path );
1082+ SCP_vector<SCP_string> mod_path = unix_get_dir_names (this_dir_path, rest );
10851083
10861084 // add all found paths relative to parent
10871085 SCP_vector<SCP_string>::iterator ii2, end2 = mod_path.end ();
@@ -1106,7 +1104,7 @@ static void handle_unix_modlist(char **modlist, int *len)
11061104 SCP_vector<SCP_string> mod_paths;
11071105 for (char *cur_mod = strtok (*modlist, " ," ); cur_mod != NULL ; cur_mod = strtok (NULL , " ," ))
11081106 {
1109- SCP_vector<SCP_string> this_mod_paths = unix_get_dir_names (cur_mod, cur_dir );
1107+ SCP_vector<SCP_string> this_mod_paths = unix_get_dir_names (cur_dir, cur_mod );
11101108 if (this_mod_paths.empty ()) {
11111109 ReleaseWarning (LOCATION, " Can't find mod '%s'" , cur_mod);
11121110 }
0 commit comments