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

Function strip_inline_comment

src/discover/discover.c:177–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

175}
176
177static void strip_inline_comment(char *s) {
178 bool in_quote = false;
179 char quote = '\0';
180 for (char *p = s; *p; p++) {
181 if ((*p == '"' || *p == '\'') && (p == s || p[-1] != '\\')) {
182 if (!in_quote) {
183 in_quote = true;
184 quote = *p;
185 } else if (*p == quote) {
186 in_quote = false;
187 }
188 continue;
189 }
190 if (!in_quote && (*p == '#' || *p == ';') && (p == s || isspace((unsigned char)p[-1]))) {
191 *p = '\0';
192 return;
193 }
194 }
195}
196
197static char *strip_matching_quotes(char *s) {
198 size_t len = strlen(s);

Callers 1

read_core_excludes_fileFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected