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

Function yaml_detect_eol

src/cli/config_yaml_edit.c:1057–1072  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1055}
1056
1057static void yaml_detect_eol(yaml_doc_t *doc) {
1058 doc->eol = "\n";
1059 doc->eol_len = YAML_UNIT;
1060 for (size_t i = 0; i < doc->line_count; i++) {
1061 const yaml_line_t *line = &doc->lines[i];
1062 if (line->end > line->text_end && line->end - line->text_end == YAML_ENTRY_INDENT &&
1063 doc->data[line->text_end] == '\r') {
1064 doc->eol = "\r\n";
1065 doc->eol_len = YAML_LITERAL_LEN("\r\n");
1066 break;
1067 }
1068 if (line->end > line->text_end) {
1069 break;
1070 }
1071 }
1072}
1073
1074static int yaml_build_lines(yaml_doc_t *doc) {
1075 size_t count = yaml_count_lines(doc);

Callers 1

yaml_build_linesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected