MCPcopy Create free account
hub / github.com/antirez/ds4 / agent_bash_finalize

Function agent_bash_finalize

ds4_agent.c:6750–6768  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6748 break;
6749 }
6750 }
6751 fclose(fp);
6752 if (!buf) buf = xstrdup("");
6753 *data = buf;
6754 *len = used;
6755 return 0;
6756}
6757
6758static int agent_line_for_offset(const agent_line_spans *spans, size_t offset) {
6759 if (!spans || spans->len <= 0) return 1;
6760 for (int i = 0; i < spans->len; i++) {
6761 if (offset < spans->v[i].end) return i + 1;
6762 }
6763 return spans->len;
6764}
6765
6766static bool agent_old_new_line_effect(const char *old_data, size_t old_len,
6767 const char *new_data, size_t new_len,
6768 size_t edit_offset, size_t replaced_len,
6769 int *start_line, int *end_line,
6770 int *delta) {
6771 agent_line_spans old_spans = {0};

Callers 1

agent_bash_pollFunction · 0.85

Tested by

no test coverage detected