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

Function sh_rewind

src/pipeline/pass_shell.c:485–496  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

483}
484
485static void sh_rewind(sh_t *s, sh_mark_t m) {
486 while (s->nundo > m.undo) {
487 const sh_undo_t *u = &s->undo[--s->nundo];
488 if (u->prev) {
489 cbm_ht_set(s->env, u->name, (void *)u->prev);
490 } else {
491 (void)cbm_ht_delete(s->env, u->name);
492 }
493 }
494 s->cwd = m.cwd;
495 s->ndirs = m.ndirs;
496}
497
498static void sh_touch_add(sh_touch_t *t, const char *name) {
499 if (sh_grow((void **)&t->names, &t->cap, t->n, sizeof(*t->names))) {

Callers 5

sh_clause_endFunction · 0.85
sh_walk_substsFunction · 0.85
sh_pipelineFunction · 0.85
sh_functionFunction · 0.85
sh_walkFunction · 0.85

Calls 2

cbm_ht_setFunction · 0.85
cbm_ht_deleteFunction · 0.85

Tested by

no test coverage detected