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

Function seed_source_dir

src/pipeline/fqn.c:238–251  ·  view source on GitHub ↗

Seed `buf` with the source file's directory (strip the basename) and * normalize backslashes. */

Source from the content-addressed store, hash-verified

236/* Seed `buf` with the source file's directory (strip the basename) and
237 * normalize backslashes. */
238static void seed_source_dir(char *buf, size_t buf_size, const char *source_rel) {
239 snprintf(buf, buf_size, "%s", source_rel ? source_rel : "");
240 for (char *p = buf; *p; p++) {
241 if (*p == '\\') {
242 *p = '/';
243 }
244 }
245 char *last = strrchr(buf, '/');
246 if (last) {
247 *last = '\0';
248 } else {
249 buf[0] = '\0';
250 }
251}
252
253/* Detect the flavor of relative import based on the leading characters.
254 * Returns 1 for Python dotted form (e.g. ".foo" or "..bar.baz"),

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected