MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / SimplifyFileName

Function SimplifyFileName

src/fileio.cpp:360–370  ·  view source on GitHub ↗

* Simplify filenames from tars. * Replace '/' by #PATHSEPCHAR, and force 'name' to lowercase. * @param name Filename to process. */

Source from the content-addressed store, hash-verified

358 * @param name Filename to process.
359 */
360static void SimplifyFileName(std::string &name)
361{
362 for (char &c : name) {
363 /* Force lowercase */
364 c = std::tolower(c);
365#if (PATHSEPCHAR != '/')
366 /* Tar-files always have '/' path-separator, but we want our PATHSEPCHAR */
367 if (c == '/') c = PATHSEPCHAR;
368#endif
369 }
370}
371
372/**
373 * Perform the scanning of a particular subdirectory.

Callers 1

AddFileMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected