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

Function yaml_detect_eol

src/cli/config_yaml_edit.c:1108–1123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1106}
1107
1108static void yaml_detect_eol(yaml_doc_t *doc) {
1109 doc->eol = "\n";
1110 doc->eol_len = YAML_UNIT;
1111 for (size_t i = 0; i < doc->line_count; i++) {
1112 const yaml_line_t *line = &doc->lines[i];
1113 if (line->end > line->text_end && line->end - line->text_end == YAML_ENTRY_INDENT &&
1114 doc->data[line->text_end] == '\r') {
1115 doc->eol = "\r\n";
1116 doc->eol_len = YAML_LITERAL_LEN("\r\n");
1117 break;
1118 }
1119 if (line->end > line->text_end) {
1120 break;
1121 }
1122 }
1123}
1124
1125static int yaml_build_lines(yaml_doc_t *doc) {
1126 size_t count = yaml_count_lines(doc);

Callers 1

yaml_build_linesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected