MCPcopy Create free account
hub / github.com/ZDoom/Raze / C_SearchForPullins

Function C_SearchForPullins

source/common/console/c_dispatch.cpp:1081–1113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1079}
1080
1081void C_SearchForPullins(FExecList *exec, const char *file, FCommandLine &argv)
1082{
1083 const char *lastSlash;
1084
1085 assert(exec != NULL);
1086 assert(file != NULL);
1087#ifdef __unix__
1088 lastSlash = strrchr(file, '/');
1089#else
1090 const char *lastSlash1, *lastSlash2;
1091
1092 lastSlash1 = strrchr(file, '/');
1093 lastSlash2 = strrchr(file, '\\');
1094 lastSlash = max(lastSlash1, lastSlash2);
1095#endif
1096
1097 for (int i = 1; i < argv.argc(); ++i)
1098 {
1099 // Try looking for the wad in the same directory as the .cfg
1100 // before looking for it in the current directory.
1101 if (lastSlash != NULL)
1102 {
1103 FString path(file, (lastSlash - file) + 1);
1104 path += argv[i];
1105 if (FileExists(path))
1106 {
1107 exec->Pullins.Push(path);
1108 continue;
1109 }
1110 }
1111 exec->Pullins.Push(argv[i]);
1112 }
1113}
1114
1115static TArray<FConsoleCommand*> dynccmds; // This needs to be explicitly deleted before shutdown - the names in here may not be valid during the exit handler.
1116//

Callers 1

AddCommandMethod · 0.85

Calls 3

argcMethod · 0.80
FileExistsFunction · 0.50
PushMethod · 0.45

Tested by

no test coverage detected