MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / stripExtension

Function stripExtension

TheForceEngine/TFE_FileSystem/fileutil.cpp:324–343  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

322 }
323
324 void stripExtension(const char* srcPath, char* outPath)
325 {
326 // Find the last '.' in the name.
327 size_t len = strlen(srcPath);
328 s32 lastDot = -1;
329 for (size_t i = 0; i < len; i++)
330 {
331 if (srcPath[i] == '.') { lastDot = (s32)i; }
332 }
333 if (lastDot >= 0)
334 {
335 outPath[0] = 0;
336 strncpy(outPath, srcPath, lastDot);
337 outPath[lastDot] = 0;
338 }
339 else
340 {
341 strcpy(outPath, srcPath);
342 }
343 }
344}

Callers 3

exportSelectedFunction · 0.50
entityNameFromAssetNameFunction · 0.50
loadLevelFromAssetFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected