| 483 | } |
| 484 | |
| 485 | static 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 | |
| 498 | static 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))) { |
no test coverage detected