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

Function shebang_next_token

src/discover/language.c:1008–1027  ·  view source on GitHub ↗

Advance *cursor past leading blanks and return the next whitespace-delimited * token (NUL-terminated in place), or NULL when the line is exhausted. */

Source from the content-addressed store, hash-verified

1006/* Advance *cursor past leading blanks and return the next whitespace-delimited
1007 * token (NUL-terminated in place), or NULL when the line is exhausted. */
1008static char *shebang_next_token(char **cursor) {
1009 char *p = *cursor;
1010 while (*p == ' ' || *p == '\t') {
1011 p++;
1012 }
1013 if (*p == '\0') {
1014 *cursor = p;
1015 return NULL;
1016 }
1017 char *start = p;
1018 while (*p && *p != ' ' && *p != '\t') {
1019 p++;
1020 }
1021 if (*p) {
1022 *p = '\0';
1023 p++;
1024 }
1025 *cursor = p;
1026 return start;
1027}
1028
1029CBMLanguage cbm_language_from_shebang(const char *path) {
1030 if (!path) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected