MCPcopy Create free account
hub / github.com/crownengine/crown / is_valid_basename

Function is_valid_basename

src/core/filesystem/path.cpp:233–246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

231 }
232
233 bool is_valid_basename(const char *basename)
234 {
235 CE_ENSURE(basename != NULL);
236
237 if (basename[0] == '\0')
238 return false;
239
240 if (strcmp(basename, ".") == 0 || strcmp(basename, "..") == 0)
241 return false;
242
243 return strchr(basename, '/') == NULL
244 && strchr(basename, '\\') == NULL
245 ;
246 }
247
248} // namespace path
249

Callers 2

test_pathFunction · 0.85
queue_requestMethod · 0.85

Calls 2

strcmpFunction · 0.85
strchrFunction · 0.85

Tested by 1

test_pathFunction · 0.68