MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / build_path

Function build_path

src/pipeline/pass_tests.c:157–170  ·  view source on GitHub ↗

Assemble dir/name+ext into a heap-allocated path. */

Source from the content-addressed store, hash-verified

155
156/* Assemble dir/name+ext into a heap-allocated path. */
157static char *build_path(const char *test_path, size_t dir_len, const char *name, size_t name_len,
158 const char *ext, size_t ext_len) {
159 char *result = malloc(dir_len + SKIP_ONE + name_len + ext_len + SKIP_ONE);
160 if (dir_len > 0) {
161 memcpy(result, test_path, dir_len);
162 result[dir_len] = '/';
163 memcpy(result + dir_len + SKIP_ONE, name, name_len);
164 memcpy(result + dir_len + SKIP_ONE + name_len, ext, ext_len + SKIP_ONE);
165 } else {
166 memcpy(result, name, name_len);
167 memcpy(result + name_len, ext, ext_len + SKIP_ONE);
168 }
169 return result;
170}
171
172/* Try to derive the production file path from a test file path.
173 * Returns heap-allocated string or NULL. Caller must free(). */

Callers 1

test_to_prod_pathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected